@@ -79,7 +79,7 @@ static Json of(@Nullable JsonEncodable value) {
7979 * @return An instance of {@link Json}.
8080 */
8181 static Json of (@ Nullable BigDecimal value ) {
82- return value == null ? JsonNull .instance () : new BigDecimalImpl (value );
82+ return value == null ? JsonNull .instance () : JsonNumber . of (value );
8383 }
8484
8585 /**
@@ -89,7 +89,7 @@ static Json of(@Nullable BigDecimal value) {
8989 * @return An instance of {@link Json}.
9090 */
9191 static Json of (double value ) {
92- return new DoubleImpl (value );
92+ return JsonNumber . of (value );
9393 }
9494
9595 /**
@@ -99,7 +99,7 @@ static Json of(double value) {
9999 * @return An instance of {@link Json}.
100100 */
101101 static Json of (long value ) {
102- return new LongImpl (value );
102+ return JsonNumber . of (value );
103103 }
104104
105105 /**
@@ -109,7 +109,7 @@ static Json of(long value) {
109109 * @return An instance of {@link Json}.
110110 */
111111 static Json of (float value ) {
112- return new DoubleImpl (value );
112+ return JsonNumber . of (value );
113113 }
114114
115115 /**
@@ -119,7 +119,7 @@ static Json of(float value) {
119119 * @return An instance of {@link Json}.
120120 */
121121 static Json of (int value ) {
122- return new LongImpl (value );
122+ return JsonNumber . of (value );
123123 }
124124
125125 /**
@@ -129,7 +129,7 @@ static Json of(int value) {
129129 * @return An instance of {@link Json}.
130130 */
131131 static Json of (@ Nullable Double value ) {
132- return value == null ? JsonNull .instance () : new DoubleImpl ( value );
132+ return value == null ? JsonNull .instance () : of (( double ) value );
133133 }
134134
135135 /**
@@ -139,7 +139,7 @@ static Json of(@Nullable Double value) {
139139 * @return An instance of {@link Json}.
140140 */
141141 static Json of (@ Nullable Long value ) {
142- return value == null ? JsonNull .instance () : new LongImpl ( value );
142+ return value == null ? JsonNull .instance () : of (( long ) value );
143143 }
144144
145145 /**
@@ -149,7 +149,7 @@ static Json of(@Nullable Long value) {
149149 * @return An instance of {@link Json}.
150150 */
151151 static Json of (@ Nullable Float value ) {
152- return value == null ? JsonNull .instance () : new DoubleImpl ( value );
152+ return value == null ? JsonNull .instance () : of (( float ) value );
153153 }
154154
155155 /**
@@ -159,7 +159,7 @@ static Json of(@Nullable Float value) {
159159 * @return An instance of {@link Json}.
160160 */
161161 static Json of (@ Nullable Integer value ) {
162- return value == null ? JsonNull .instance () : new LongImpl ( value );
162+ return value == null ? JsonNull .instance () : of (( int ) value );
163163 }
164164
165165 /**
@@ -169,7 +169,7 @@ static Json of(@Nullable Integer value) {
169169 * @return An instance of {@link Json}.
170170 */
171171 static Json of (@ Nullable BigInteger value ) {
172- return value == null ? JsonNull .instance () : new BigIntegerImpl (value );
172+ return value == null ? JsonNull .instance () : JsonNumber . of (value );
173173 }
174174
175175 /**
0 commit comments