//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.tongtech.tfw.backend.common.models.supers;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tongtech.tfw.backend.core.helper.bean.BeanHelper;
import com.tongtech.tfw.backend.core.helper.json.JacksonHelper;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

public class SuperModel implements Serializable {
    private static final long serialVersionUID = 9164512700020011937L;
    @ApiModelProperty("状态：0正常 1删除 2停用")
    @TableField(
            value = "status",
            fill = FieldFill.INSERT
    )
    private String status;
    @ApiModelProperty("创建者")
    @TableField(
            value = "create_by",
            fill = FieldFill.INSERT
    )
    private String createBy;
    @ApiModelProperty("创建时间")
    @TableField(
            value = "create_date",
            fill = FieldFill.INSERT
    )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @ApiModelProperty("最后一次更新者")
    @TableField(
            value = "update_by",
            fill = FieldFill.INSERT_UPDATE
    )
    private String updateBy;
    @ApiModelProperty("最后一次更新时间")
    @TableField(
            value = "update_date",
            fill = FieldFill.INSERT_UPDATE
    )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateDate;
    @ApiModelProperty("备注")
    @TableField("remarks")
    private String remarks;
    public static final String STATUS = "status";
    public static final String CREATE_BY = "create_by";
    public static final String CREATE_DATE = "create_date";
    public static final String UPDATE_BY = "update_by";
    public static final String UPDATE_DATE = "update_date";
    public static final String REMARKS = "remarks";
    public static final String STATUS_JAVA = "status";
    public static final String CREATE_BY_JAVA = "createBy";
    public static final String CREATE_DATE_JAVA = "createDate";
    public static final String UPDATE_BY_JAVA = "updateBy";
    public static final String UPDATE_DATE_JAVA = "updateDate";
    public static final String REMARKS_JAVA = "remarks";

    public <T> T beanToBean(Class<T> targetClass) {
        return BeanHelper.beanToBean(this, targetClass);
    }

    public String jsonFormat() {
        return JacksonHelper.toJson(this);
    }

    protected SuperModel(final SuperModel.SuperModelBuilder<?, ?> b) {
        this.status = b.status;
        this.createBy = b.createBy;
        this.createDate = b.createDate;
        this.updateBy = b.updateBy;
        this.updateDate = b.updateDate;
        this.remarks = b.remarks;
    }

    public static SuperModel.SuperModelBuilder<?, ?> builder() {
        return new SuperModel.SuperModelBuilderImpl();
    }

    public String getStatus() {
        return this.status;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public Date getCreateDate() {
        return this.createDate;
    }

    public String getUpdateBy() {
        return this.updateBy;
    }

    public Date getUpdateDate() {
        return this.updateDate;
    }

    public String getRemarks() {
        return this.remarks;
    }

    public void setStatus(final String status) {
        this.status = status;
    }

    public void setCreateBy(final String createBy) {
        this.createBy = createBy;
    }

    public void setCreateDate(final Date createDate) {
        if (createDate == null){
            this.createDate = new Date();
        }else {
            this.createDate = createDate;
        }
    }

    public void setUpdateBy(final String updateBy) {
        this.updateBy = updateBy;
    }

    public void setUpdateDate(final Date updateDate) {
        if (updateDate == null){
            this.updateDate = new Date();
        }else {
            this.updateDate = updateDate;
        }


    }

    public void setRemarks(final String remarks) {
        this.remarks = remarks;
    }

    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof SuperModel)) {
            return false;
        } else {
            SuperModel other = (SuperModel)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$status = this.getStatus();
                Object other$status = other.getStatus();
                if (this$status == null) {
                    if (other$status != null) {
                        return false;
                    }
                } else if (!this$status.equals(other$status)) {
                    return false;
                }

                Object this$createBy = this.getCreateBy();
                Object other$createBy = other.getCreateBy();
                if (this$createBy == null) {
                    if (other$createBy != null) {
                        return false;
                    }
                } else if (!this$createBy.equals(other$createBy)) {
                    return false;
                }

                Object this$createDate = this.getCreateDate();
                Object other$createDate = other.getCreateDate();
                if (this$createDate == null) {
                    if (other$createDate != null) {
                        return false;
                    }
                } else if (!this$createDate.equals(other$createDate)) {
                    return false;
                }

                label62: {
                    Object this$updateBy = this.getUpdateBy();
                    Object other$updateBy = other.getUpdateBy();
                    if (this$updateBy == null) {
                        if (other$updateBy == null) {
                            break label62;
                        }
                    } else if (this$updateBy.equals(other$updateBy)) {
                        break label62;
                    }

                    return false;
                }

                label55: {
                    Object this$updateDate = this.getUpdateDate();
                    Object other$updateDate = other.getUpdateDate();
                    if (this$updateDate == null) {
                        if (other$updateDate == null) {
                            break label55;
                        }
                    } else if (this$updateDate.equals(other$updateDate)) {
                        break label55;
                    }

                    return false;
                }

                Object this$remarks = this.getRemarks();
                Object other$remarks = other.getRemarks();
                if (this$remarks == null) {
                    if (other$remarks != null) {
                        return false;
                    }
                } else if (!this$remarks.equals(other$remarks)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof SuperModel;
    }


    @Override
    public String toString() {
        return "SuperModel(status=" + this.getStatus() + ", createBy=" + this.getCreateBy() + ", createDate=" + this.getCreateDate() + ", updateBy=" + this.getUpdateBy() + ", updateDate=" + this.getUpdateDate() + ", remarks=" + this.getRemarks() + ")";
    }

    public SuperModel() {
    }

    public SuperModel(final String status, final String createBy, final Date createDate, final String updateBy, final Date updateDate, final String remarks) {
        this.status = status;
        this.createBy = createBy;
        this.createDate = createDate;
        this.updateBy = updateBy;
        this.updateDate = updateDate;
        this.remarks = remarks;
    }

    private static final class SuperModelBuilderImpl extends SuperModel.SuperModelBuilder<SuperModel, SuperModel.SuperModelBuilderImpl> {
        private SuperModelBuilderImpl() {
        }

        @Override
        protected SuperModel.SuperModelBuilderImpl self() {
            return this;
        }

        @Override
        public SuperModel build() {
            return new SuperModel(this);
        }
    }

    public abstract static class SuperModelBuilder<C extends SuperModel, B extends SuperModel.SuperModelBuilder<C, B>> {
        private String status;
        private String createBy;
        private Date createDate;
        private String updateBy;
        private Date updateDate;
        private String remarks;

        public SuperModelBuilder() {
        }

        protected abstract B self();

        public abstract C build();

        public B status(final String status) {
            this.status = status;
            return this.self();
        }

        public B createBy(final String createBy) {
            this.createBy = createBy;
            return this.self();
        }

        public B createDate(final Date createDate) {
            this.createDate = createDate;
            return this.self();
        }

        public B updateBy(final String updateBy) {
            this.updateBy = updateBy;
            return this.self();
        }

        public B updateDate(final Date updateDate) {
            this.updateDate = updateDate;
            return this.self();
        }

        public B remarks(final String remarks) {
            this.remarks = remarks;
            return this.self();
        }

        @Override
        public String toString() {
            return "SuperModel.SuperModelBuilder(status=" + this.status + ", createBy=" + this.createBy + ", createDate=" + this.createDate + ", updateBy=" + this.updateBy + ", updateDate=" + this.updateDate + ", remarks=" + this.remarks + ")";
        }
    }
}
