top.doudou.common.tool.dto.SectionDto Maven / Gradle / Ivy
package top.doudou.common.tool.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 区间实体类
* @Author 傻男人 <[email protected]>
* @Date 2020-10-09 11:45
* @Version V1.0
*/
@Data
public class SectionDto implements Serializable {
private static final long serialVersionUID = 3287076273806845279L;
@ApiModelProperty(value = "区间的最大值")
private BigDecimal max;
@ApiModelProperty(value = "是否包含最大值")
private boolean containMax;
@ApiModelProperty(value = "区间内的最小值")
private BigDecimal min;
@ApiModelProperty(value = "是否包含最小值")
private boolean containMin;
public SectionDto(){}
public SectionDto(BigDecimal max, boolean containMax, BigDecimal min, boolean containMin){
this.max = max;
this.containMax = containMax;
this.min = min;
this.containMin = containMin;
}
public SectionDto(BigDecimal max, BigDecimal min){
this.max = max;
this.min = min;
}
public SectionDto(Double max, boolean containMax, Double min, boolean containMin){
this.max = BigDecimal.valueOf(max);
this.containMax = containMax;
this.min = BigDecimal.valueOf(min);
this.containMin = containMin;
}
public SectionDto(Double max, Double min){
this.max = BigDecimal.valueOf(max);
this.min = BigDecimal.valueOf(min);
}
}