This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch 2933-rename-class-jsonldserializer
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to 
refs/heads/2933-rename-class-jsonldserializer by this push:
     new 57b5b47b98 refactor(#2933): Rename class JsonLdSerializer to 
CouchDbJsonSerializer
57b5b47b98 is described below

commit 57b5b47b98fb0280f696d71c5ec3ae16ce183060
Author: Philipp Zehnder <[email protected]>
AuthorDate: Sun Jun 16 20:01:18 2024 +0200

    refactor(#2933): Rename class JsonLdSerializer to CouchDbJsonSerializer
---
 ...dSerializer.java => CouchDbJsonSerializer.java} |  4 ++--
 .../storage/couchdb/serializer/GsonSerializer.java | 26 ++++++++++------------
 2 files changed, 14 insertions(+), 16 deletions(-)

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 org.slf4j.LoggerFactory;
 import java.lang.reflect.MalformedParameterizedTypeException;
 import java.lang.reflect.Type;
 
-public class JsonLdSerializer<T> implements JsonDeserializer<T>, 
JsonSerializer<T> {
+public class CouchDbJsonSerializer<T> implements JsonDeserializer<T>, 
JsonSerializer<T> {
 
-  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 class GsonSerializer {
     GsonBuilder builder = getGsonBuilder();
     builder.registerTypeHierarchyAdapter(AdapterDescription.class, new 
AdapterSerializer());
     builder.registerTypeAdapter(TransformationRuleDescription.class,
-        new JsonLdSerializer<TransformationRuleDescription>());
+        new CouchDbJsonSerializer<TransformationRuleDescription>());
 //    
builder.registerTypeHierarchyAdapter(TransformationRuleDescription.class, new 
AdapterSerializer());
 
     return builder;
@@ -82,20 +82,20 @@ public class GsonSerializer {
 
   public static GsonBuilder getGsonBuilder() {
     GsonBuilder builder = new GsonBuilder();
-    builder.registerTypeAdapter(EventProperty.class, new 
JsonLdSerializer<EventProperty>());
-    builder.registerTypeAdapter(StaticProperty.class, new 
JsonLdSerializer<StaticProperty>());
-    builder.registerTypeAdapter(OutputStrategy.class, new 
JsonLdSerializer<OutputStrategy>());
-    builder.registerTypeAdapter(TransportProtocol.class, new 
JsonLdSerializer<TransportProtocol>());
-    builder.registerTypeAdapter(MappingProperty.class, new 
JsonLdSerializer<MappingProperty>());
-    builder.registerTypeAdapter(ValueSpecification.class, new 
JsonLdSerializer<ValueSpecification>());
+    builder.registerTypeAdapter(EventProperty.class, new 
CouchDbJsonSerializer<EventProperty>());
+    builder.registerTypeAdapter(StaticProperty.class, new 
CouchDbJsonSerializer<StaticProperty>());
+    builder.registerTypeAdapter(OutputStrategy.class, new 
CouchDbJsonSerializer<OutputStrategy>());
+    builder.registerTypeAdapter(TransportProtocol.class, new 
CouchDbJsonSerializer<TransportProtocol>());
+    builder.registerTypeAdapter(MappingProperty.class, new 
CouchDbJsonSerializer<MappingProperty>());
+    builder.registerTypeAdapter(ValueSpecification.class, new 
CouchDbJsonSerializer<ValueSpecification>());
     builder.registerTypeAdapter(DataSinkType.class, new EcTypeAdapter());
     builder.registerTypeAdapter(AdapterType.class, new AdapterTypeAdapter());
-    builder.registerTypeAdapter(Message.class, new 
JsonLdSerializer<Message>());
+    builder.registerTypeAdapter(Message.class, new 
CouchDbJsonSerializer<Message>());
     builder.registerTypeAdapter(DataProcessorType.class, new EpaTypeAdapter());
     builder.registerTypeAdapter(URI.class, new UriSerializer());
-    builder.registerTypeAdapter(TopicDefinition.class, new 
JsonLdSerializer<TopicDefinition>());
+    builder.registerTypeAdapter(TopicDefinition.class, new 
CouchDbJsonSerializer<TopicDefinition>());
     builder.registerTypeAdapter(TransformationRuleDescription.class,
-        new JsonLdSerializer<TransformationRuleDescription>());
+        new CouchDbJsonSerializer<TransformationRuleDescription>());
     
builder.registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(SpDataStream.class,
 "sourceType")
         .registerSubtype(SpDataStream.class, 
"org.apache.streampipes.model.SpDataStream"));
 
@@ -142,10 +142,8 @@ public class GsonSerializer {
         if (f.getName().equals("elementName")) {
           return true;
         }
-        if (f.getName().equals("elementId")) {
-          return true;
-        }
-        return false;
+        return f.getName()
+                .equals("elementId");
       }
 
       @Override

Reply via email to