1919import java .io .StringReader ;
2020import java .util .List ;
2121import java .util .Map ;
22- import java .util .Objects ;
2322import java .util .stream .Collectors ;
2423
2524public enum JSON implements Serializer <JSON .Node > {
@@ -193,9 +192,9 @@ public static JSON.Object of(Map<String, java.lang.Object> map) {
193192 }
194193
195194 @ Override
196- public String toString () {
195+ public String toSerializedString () {
197196 return map .entrySet ().stream ()
198- .map (e -> "\" %s\" : %s" .formatted (e .getKey (), e .getValue ().toString ()))
197+ .map (e -> "\" %s\" : %s" .formatted (e .getKey (), e .getValue ().toSerializedString ()))
199198 .collect (Collectors .joining (", " , "{" , "}" ));
200199 }
201200 }
@@ -210,9 +209,9 @@ public static JSON.Array of(List<java.lang.Object> list) {
210209 }
211210
212211 @ Override
213- public String toString () {
212+ public String toSerializedString () {
214213 return list .stream ()
215- .map (Objects :: toString )
214+ .map (DataNode :: toSerializedString )
216215 .collect (Collectors .joining (", " , "[" , "]" ));
217216 }
218217 }
@@ -231,9 +230,9 @@ public Value(@Nullable T value) {
231230 }
232231
233232 @ Override
234- public String toString () {
233+ public @ NotNull String toSerializedString () {
235234 // this method is a super-stub because it depends on the functionality of the underlying method
236- return super .toString ();
235+ return super .toSerializedString ();
237236 }
238237 }
239238}
0 commit comments