package com.zy.acs.common.domain;
|
|
import com.zy.acs.framework.exception.CoolException;
|
import lombok.Data;
|
|
import java.io.Serializable;
|
|
@Data
|
public class HeightDepthDto implements Serializable {
|
|
private static final long serialVersionUID = 1304095271854524735L;
|
|
// 高度(mm)
|
private Short height;
|
|
// 深度(mm)
|
private Short depth;
|
|
public HeightDepthDto() {
|
}
|
|
public HeightDepthDto(Number height) {
|
this.height = toShort(height);
|
}
|
|
public HeightDepthDto(Number height, Number depth) {
|
this.height = toShort(height);
|
this.depth = toShort(depth);
|
}
|
|
private static Short toShort(Number value) {
|
if (value == null) {
|
throw new CoolException("HeightDepthDto parameter is null");
|
}
|
return value.shortValue();
|
}
|
|
}
|