@@ -40,10 +40,15 @@ interface KnownType {
40
40
41
41
KnownTypes () {
42
42
add (new StringType (), String .class , char [].class , CharSequence .class );
43
- add (new BoolType (), boolean .class , Boolean .class );
44
- add (new IntegerType (), int .class , Integer .class );
45
- add (new LongType (), long .class , Long .class );
46
- add (new NumberType (), double .class , Double .class , float .class , Float .class , BigDecimal .class , BigInteger .class );
43
+ add (new BoolType (), boolean .class );
44
+ add (new BooleanType (), Boolean .class );
45
+ add (new IntType (), int .class );
46
+ add (new IntegerType (), Integer .class );
47
+ add (new PLongType (), long .class );
48
+ add (new LongType (), Long .class );
49
+
50
+ add (new PNumberType (), double .class , float .class );
51
+ add (new NumberType (), Double .class , Float .class , BigDecimal .class , BigInteger .class );
47
52
add (new DateType (), LocalDate .class , java .sql .Date .class );
48
53
add (new DateTimeType (), Instant .class , OffsetDateTime .class , ZonedDateTime .class , Timestamp .class , java .util .Date .class , LocalDateTime .class );
49
54
@@ -82,26 +87,54 @@ public Schema<?> createSchema() {
82
87
}
83
88
84
89
private class BoolType implements KnownType {
90
+ @ Override
91
+ public Schema <?> createSchema () {
92
+ return new BooleanSchema ().nullable (Boolean .FALSE );
93
+ }
94
+ }
95
+
96
+ private class BooleanType implements KnownType {
85
97
@ Override
86
98
public Schema <?> createSchema () {
87
99
return new BooleanSchema ();
88
100
}
89
101
}
90
102
103
+ private class IntType implements KnownType {
104
+ @ Override
105
+ public Schema <?> createSchema () {
106
+ return new IntegerSchema ().nullable (Boolean .FALSE );
107
+ }
108
+ }
109
+
91
110
private class IntegerType implements KnownType {
92
111
@ Override
93
112
public Schema <?> createSchema () {
94
113
return new IntegerSchema ();
95
114
}
96
115
}
97
116
117
+ private class PLongType implements KnownType {
118
+ @ Override
119
+ public Schema <?> createSchema () {
120
+ return new IntegerSchema ().format ("int64" ).nullable (Boolean .FALSE );
121
+ }
122
+ }
123
+
98
124
private class LongType implements KnownType {
99
125
@ Override
100
126
public Schema <?> createSchema () {
101
127
return new IntegerSchema ().format ("int64" );
102
128
}
103
129
}
104
130
131
+ private class PNumberType implements KnownType {
132
+ @ Override
133
+ public Schema <?> createSchema () {
134
+ return new NumberSchema ().nullable (Boolean .FALSE );
135
+ }
136
+ }
137
+
105
138
private class NumberType implements KnownType {
106
139
@ Override
107
140
public Schema <?> createSchema () {
0 commit comments