zhangc
6 天以前 84e12ecd3923f28b62b8659b138a554b0f6e084d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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();
    }
 
}