CountType.java

package com.mycim.valueobject.ems.pilot;

import com.mycim.framework.utils.lang.time.DateUtils;
import com.mycim.valueobject.ems.pilot.dto.PiLotSetupDTO;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author songpy
 * @version 1.0.0
 * @date 2021/8/18
 **/
public class CountType implements Serializable {

    private static final long serialVersionUID = -6693263533812627603L;

    private String type;

    private Integer countSpec;

    private Timestamp timePoint;

    private String triggerRcpId;

    private Long triggerRcpRrn = 0L;

    private String constraintRcpId;

    private Long constraintRcpRrn = 0L;

    public CountType(String type, Integer countSpec, Timestamp timePoint, String triggerRcp, String constraintRcp) {
        this.type = type;
        this.countSpec = countSpec;
        this.timePoint = timePoint;
        this.triggerRcpId = triggerRcp;
        this.constraintRcpId = constraintRcp;
    }

    public CountType(PiLotSetupDTO setupDTO) {
        this.type = setupDTO.getCountType();
        this.countSpec = setupDTO.getCountSpec();
        this.timePoint = DateUtils.stringToTimestamp(setupDTO.getTimePointDate());
        this.triggerRcpId = setupDTO.getCountTriggerRecipe();
        this.constraintRcpId = setupDTO.getCountConstraintRecipe();
    }

    public CountType() {
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getCountSpec() {
        return countSpec;
    }

    public void setCountSpec(Integer countSpec) {
        this.countSpec = countSpec;
    }

    public Timestamp getTimePoint() {
        return timePoint;
    }

    public void setTimePoint(Timestamp timePoint) {
        this.timePoint = timePoint;
    }

    public String getTriggerRcpId() {
        return triggerRcpId;
    }

    public void setTriggerRcpId(String triggerRcpId) {
        this.triggerRcpId = triggerRcpId;
    }

    public String getConstraintRcpId() {
        return constraintRcpId;
    }

    public void setConstraintRcpId(String constraintRcpId) {
        this.constraintRcpId = constraintRcpId;
    }

    @Override
    public String toString() {
        return "CountType{" + "type='" + type + '\'' + ", countSpec=" + countSpec + ", timePoint=" + timePoint +
                ", triggerRcpId='" + triggerRcpId + '\'' + ", triggerRcpRrn=" + triggerRcpRrn + ", constraintRcpId='" +
                constraintRcpId + '\'' + ", constraintRcpRrn=" + constraintRcpRrn + '}';
    }

    public Long getTriggerRcpRrn() {
        return triggerRcpRrn;
    }

    public void setTriggerRcpRrn(Long triggerRcpRrn) {
        this.triggerRcpRrn = triggerRcpRrn;
    }

    public Long getConstraintRcpRrn() {
        return constraintRcpRrn;
    }

    public void setConstraintRcpRrn(Long constraintRcpRrn) {
        this.constraintRcpRrn = constraintRcpRrn;
    }

}