diff --git a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/JsonLdSerializer.java b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/CouchDbJsonSerializer.java similarity index 92% rename from streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/JsonLdSerializer.java rename to streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/CouchDbJsonSerializer.java index 4891c8e996..45ab82a0cc 100644 --- a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/JsonLdSerializer.java +++ b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/CouchDbJsonSerializer.java @@ -32,9 +32,9 @@ import java.lang.reflect.MalformedParameterizedTypeException; import java.lang.reflect.Type; -public class JsonLdSerializer implements JsonDeserializer, JsonSerializer { +public class CouchDbJsonSerializer implements JsonDeserializer, JsonSerializer { - private static final Logger LOG = LoggerFactory.getLogger(JsonLdSerializer.class); + private static final Logger LOG = LoggerFactory.getLogger(CouchDbJsonSerializer.class); @Override public T deserialize(JsonElement json, Type typeOfT, diff --git a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/GsonSerializer.java b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/GsonSerializer.java index bf105541b9..f141497ad5 100644 --- a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/GsonSerializer.java +++ b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/serializer/GsonSerializer.java @@ -59,7 +59,7 @@ public static GsonBuilder getAdapterGsonBuilder() { GsonBuilder builder = getGsonBuilder(); builder.registerTypeHierarchyAdapter(AdapterDescription.class, new AdapterSerializer()); builder.registerTypeAdapter(TransformationRuleDescription.class, - new JsonLdSerializer()); + new CouchDbJsonSerializer()); // builder.registerTypeHierarchyAdapter(TransformationRuleDescription.class, new AdapterSerializer()); return builder; @@ -82,20 +82,20 @@ public static Gson getGson() { public static GsonBuilder getGsonBuilder() { GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(EventProperty.class, new JsonLdSerializer()); - builder.registerTypeAdapter(StaticProperty.class, new JsonLdSerializer()); - builder.registerTypeAdapter(OutputStrategy.class, new JsonLdSerializer()); - builder.registerTypeAdapter(TransportProtocol.class, new JsonLdSerializer()); - builder.registerTypeAdapter(MappingProperty.class, new JsonLdSerializer()); - builder.registerTypeAdapter(ValueSpecification.class, new JsonLdSerializer()); + builder.registerTypeAdapter(EventProperty.class, new CouchDbJsonSerializer()); + builder.registerTypeAdapter(StaticProperty.class, new CouchDbJsonSerializer()); + builder.registerTypeAdapter(OutputStrategy.class, new CouchDbJsonSerializer()); + builder.registerTypeAdapter(TransportProtocol.class, new CouchDbJsonSerializer()); + builder.registerTypeAdapter(MappingProperty.class, new CouchDbJsonSerializer()); + builder.registerTypeAdapter(ValueSpecification.class, new CouchDbJsonSerializer()); builder.registerTypeAdapter(DataSinkType.class, new EcTypeAdapter()); builder.registerTypeAdapter(AdapterType.class, new AdapterTypeAdapter()); - builder.registerTypeAdapter(Message.class, new JsonLdSerializer()); + builder.registerTypeAdapter(Message.class, new CouchDbJsonSerializer()); builder.registerTypeAdapter(DataProcessorType.class, new EpaTypeAdapter()); builder.registerTypeAdapter(URI.class, new UriSerializer()); - builder.registerTypeAdapter(TopicDefinition.class, new JsonLdSerializer()); + builder.registerTypeAdapter(TopicDefinition.class, new CouchDbJsonSerializer()); builder.registerTypeAdapter(TransformationRuleDescription.class, - new JsonLdSerializer()); + new CouchDbJsonSerializer()); builder.registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(SpDataStream.class, "sourceType") .registerSubtype(SpDataStream.class, "org.apache.streampipes.model.SpDataStream")); @@ -142,10 +142,8 @@ public boolean shouldSkipField(FieldAttributes f) { if (f.getName().equals("elementName")) { return true; } - if (f.getName().equals("elementId")) { - return true; - } - return false; + return f.getName() + .equals("elementId"); } @Override