package vn.azteam.tpf.service.dto;

import java.io.Serializable;
import java.util.Objects;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;

/**
 * A DTO for the TBGuidelinePeriod entity.
 */
public class TBGuidelinePeriodDTO implements Serializable {
    // @NotEmpty validates that the property is not null or empty; can be applied to String, Collection, Map or Array values.
    // @NotNull validates that the annotated property value is not null.
    // @NotBlank can be applied only to text values and validates that the property is not null or whitespace.
    // @PositiveOrZero apply to numeric values and validate that they are strictly positive, or positive including 0.

    private Long id;

    @NotBlank 
    private String name;

    @NotNull @PositiveOrZero
    private Integer ageDayStart;

    @NotNull @PositiveOrZero
    private Integer ageDayEnd;

    @NotNull @Positive
    private Long tbGuidelineId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAgeDayStart() {
        return ageDayStart;
    }

    public void setAgeDayStart(Integer ageDayStart) {
        this.ageDayStart = ageDayStart;
    }

    public Integer getAgeDayEnd() {
        return ageDayEnd;
    }

    public void setAgeDayEnd(Integer ageDayEnd) {
        this.ageDayEnd = ageDayEnd;
    }

    public Long getTbGuidelineId() {
        return tbGuidelineId;
    }

    public void setTbGuidelineId(Long tbGuidelineId) {
        this.tbGuidelineId = tbGuidelineId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TBGuidelinePeriodDTO tBGuidelinePeriodDTO = (TBGuidelinePeriodDTO) o;
        if (tBGuidelinePeriodDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBGuidelinePeriodDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TBGuidelinePeriodDTO{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", ageDayStart=" + getAgeDayStart() +
            ", ageDayEnd=" + getAgeDayEnd() +
            "}";
    }
}
