2424
2525public class ColDataType implements Serializable {
2626
27+ public enum Signedness {
28+ SIGNED , UNSIGNED
29+ }
30+
2731 private String dataType ;
2832 private List <String > argumentsStringList ;
2933 private String characterSet ;
3034 private IntervalQualifier intervalQualifier ;
3135 private List <Integer > arrayData = new ArrayList <Integer >();
36+ private Signedness signedness ;
37+ private boolean zerofill ;
3238 private Integer precision ;
3339 private Integer scale ;
3440
@@ -98,6 +104,22 @@ public void setArrayData(List<Integer> arrayData) {
98104 this .arrayData = arrayData ;
99105 }
100106
107+ public Signedness getSignedness () {
108+ return signedness ;
109+ }
110+
111+ public void setSignedness (Signedness signedness ) {
112+ this .signedness = signedness ;
113+ }
114+
115+ public boolean isZerofill () {
116+ return zerofill ;
117+ }
118+
119+ public void setZerofill (boolean zerofill ) {
120+ this .zerofill = zerofill ;
121+ }
122+
101123 /**
102124 * The first numeric type parameter, e.g. {@code 255} for {@code VARCHAR(255)} or {@code 10} for
103125 * {@code DECIMAL(10, 2)}. {@code MAX} is reported as {@link Integer#MAX_VALUE}. Returns
@@ -139,6 +161,8 @@ public String toString() {
139161 + (argumentsStringList != null
140162 ? " " + PlainSelect .getStringList (argumentsStringList , true , true )
141163 : "" )
164+ + (signedness != null ? " " + signedness : "" )
165+ + (zerofill ? " ZEROFILL" : "" )
142166 + arraySpec .toString ()
143167 + (characterSet != null ? " CHARACTER SET " + characterSet : "" );
144168 }
@@ -168,6 +192,16 @@ public ColDataType withArrayData(List<Integer> arrayData) {
168192 return this ;
169193 }
170194
195+ public ColDataType withSignedness (Signedness signedness ) {
196+ setSignedness (signedness );
197+ return this ;
198+ }
199+
200+ public ColDataType withZerofill (boolean zerofill ) {
201+ setZerofill (zerofill );
202+ return this ;
203+ }
204+
171205 public ColDataType withPrecision (Integer precision ) {
172206 this .setPrecision (precision );
173207 return this ;
@@ -218,7 +252,9 @@ public final boolean equals(Object o) {
218252 && Objects .equals (argumentsStringList , that .argumentsStringList )
219253 && Objects .equals (characterSet , that .characterSet )
220254 && Objects .equals (intervalQualifier , that .intervalQualifier )
221- && Objects .equals (arrayData , that .arrayData );
255+ && Objects .equals (arrayData , that .arrayData )
256+ && signedness == that .signedness
257+ && zerofill == that .zerofill ;
222258 }
223259
224260 @ Override
@@ -228,6 +264,8 @@ public int hashCode() {
228264 result = 31 * result + Objects .hashCode (characterSet );
229265 result = 31 * result + Objects .hashCode (intervalQualifier );
230266 result = 31 * result + Objects .hashCode (arrayData );
267+ result = 31 * result + Objects .hashCode (signedness );
268+ result = 31 * result + Boolean .hashCode (zerofill );
231269 return result ;
232270 }
233271}
0 commit comments