package com.lanyuanxiaoyao.service.web.entity;

import cn.hutool.core.io.unit.DataSizeUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.lanyuanxiaoyao.service.configuration.entity.hudi.HPath;

/**
 * @author lanyuanxiaoyao
 * @date 2024-04-26
 */
public class HPathVO {
    @JsonIgnore
    private final HPath hPath;

    private final Boolean defer;
    private final String sizeText;

    public HPathVO(HPath hPath) {
        this.hPath = hPath;
        this.defer = hPath.getFolder();
        this.sizeText = DataSizeUtil.format(hPath.getSize());
    }

    public String getName() {
        return hPath.getName();
    }

    public String getPath() {
        return hPath.getPath();
    }

    public Boolean getFile() {
        return hPath.getFile();
    }

    public Boolean getFolder() {
        return hPath.getFolder();
    }

    public Long getSize() {
        return hPath.getSize();
    }

    public String getGroup() {
        return hPath.getGroup();
    }

    public String getOwner() {
        return hPath.getOwner();
    }

    public String getPermission() {
        return hPath.getPermission();
    }

    public Integer getReplication() {
        return hPath.getReplication();
    }

    public Long getModifyTime() {
        return hPath.getModifyTime();
    }

    public Boolean getDefer() {
        return defer;
    }

    public String getSizeText() {
        return sizeText;
    }

    @Override
    public String toString() {
        return "HPathVO{" +
               "hPath=" + hPath +
               ", defer=" + defer +
               ", sizeText='" + sizeText + '\'' +
               '}';
    }
}
