1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.coeus.sys.api.model;
17
18 import java.math.BigDecimal;
19
20
21
22
23
24
25
26
27
28
29
30 public final class ScaleTwoDecimal extends AbstractDecimal<ScaleTwoDecimal> {
31
32 private static final long serialVersionUID = 1602860735060812811L;
33
34 public static final int SCALE = 2;
35
36 public static final ScaleTwoDecimal ZERO = new ScaleTwoDecimal(0);
37 public static final ScaleTwoDecimal ONE_HUNDRED = new ScaleTwoDecimal(100);
38
39
40
41 private ScaleTwoDecimal() {
42 super();
43 }
44
45 public ScaleTwoDecimal(String value) {
46 super(value, SCALE);
47 }
48
49 public ScaleTwoDecimal(int value) {
50 super(value, SCALE);
51 }
52
53 public ScaleTwoDecimal(double value) {
54 super(value, SCALE);
55 }
56
57 public ScaleTwoDecimal(BigDecimal value) {
58 super(value, SCALE);
59 }
60
61 private ScaleTwoDecimal(String value, int scale) {
62 super(value, scale);
63 }
64
65 private ScaleTwoDecimal(int value, int scale) {
66 super(value, scale);
67 }
68
69 private ScaleTwoDecimal(double value, int scale) {
70 super(value, scale);
71 }
72
73 private ScaleTwoDecimal(BigDecimal value, int scale) {
74 super(value, scale);
75 }
76
77 @Override
78 protected ScaleTwoDecimal newInstance(int value) {
79 return new ScaleTwoDecimal(value);
80 }
81
82 @Override
83 protected ScaleTwoDecimal newInstance(BigDecimal value, int scale) {
84 return new ScaleTwoDecimal(value, scale);
85 }
86
87 @Override
88 protected ScaleTwoDecimal zero() {
89 return ZERO;
90 }
91
92 @Override
93 protected ScaleTwoDecimal oneHundred() {return ONE_HUNDRED; }
94
95
96
97
98
99 public static ScaleTwoDecimal returnZeroIfNull(ScaleTwoDecimal value){
100 return value==null ? ScaleTwoDecimal.ZERO : value;
101 }
102 }