Skip to content

Commit

Permalink
more work on OBACLOUD-111
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonabrown committed Dec 17, 2021
1 parent 02d42e4 commit e8bc4d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ public JsonSerializer<Object> findNullValueSerializer(BeanProperty property) thr
if (property.getType().getRawClass().equals(String.class))
return Serializers.EMPTY_STRING_SERIALIZER_INSTANCE;
if (property.getType().getRawClass().equals(Long.class))
return Serializers.NULL_LONG_SERIALIZER_INSTANCE;
return Serializers.NULL_NUMBER_SERIALIZER_INSTANCE;
if (property.getType().getRawClass().equals(Integer.class))
return Serializers.NULL_NUMBER_SERIALIZER_INSTANCE;
if (property.getType().getRawClass().equals(Double.class))
return Serializers.NULL_NUMBER_SERIALIZER_INSTANCE;
if (property.getType().getRawClass().equals(Collection.class) || property.getType().getRawClass().equals(List.class))
return Serializers.NULL_COLLECTION_SERIALIZER_INSTANCE;
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class Serializers extends JsonSerializer<Object> {
public static final JsonSerializer<Object> EMPTY_STRING_SERIALIZER_INSTANCE = new EmptyStringSerializer();
public static final JsonSerializer<Object> NULL_LONG_SERIALIZER_INSTANCE = new NullLongSerializer();
public static final JsonSerializer<Object> NULL_NUMBER_SERIALIZER_INSTANCE = new NullNumberSerializer();
public static final JsonSerializer<Object> NULL_COLLECTION_SERIALIZER_INSTANCE = new NullCollectionSerializer();


Expand All @@ -46,8 +46,8 @@ public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider
}
}

private static class NullLongSerializer extends JsonSerializer<Object> {
public NullLongSerializer() {}
private static class NullNumberSerializer extends JsonSerializer<Object> {
public NullNumberSerializer() {}

@Override
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
Expand Down

0 comments on commit e8bc4d9

Please sign in to comment.