diff --git a/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaSetter.java b/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaDeserializationProperty.java similarity index 91% rename from RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaSetter.java rename to RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaDeserializationProperty.java index 03c4f1a..1be2edb 100644 --- a/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaSetter.java +++ b/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaDeserializationProperty.java @@ -18,7 +18,7 @@ ) @Retention(RetentionPolicy.RUNTIME) @RosettaAnnotation -public @interface RosettaSetter { +public @interface RosettaDeserializationProperty { String USE_DEFAULT_NAME = ""; String value() default USE_DEFAULT_NAME; diff --git a/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaGetter.java b/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaSerializationProperty.java similarity index 91% rename from RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaGetter.java rename to RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaSerializationProperty.java index 52d5bd4..436b2f2 100644 --- a/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaGetter.java +++ b/RosettaAnnotations/src/main/java/com/hubspot/rosetta/annotations/RosettaSerializationProperty.java @@ -18,7 +18,7 @@ ) @Retention(RetentionPolicy.RUNTIME) @RosettaAnnotation -public @interface RosettaGetter { +public @interface RosettaSerializationProperty { String USE_DEFAULT_NAME = ""; String value() default USE_DEFAULT_NAME; diff --git a/RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaAnnotationIntrospector.java b/RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaAnnotationIntrospector.java index 41b5d79..7bb52fc 100644 --- a/RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaAnnotationIntrospector.java +++ b/RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaAnnotationIntrospector.java @@ -14,13 +14,13 @@ import com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector; import com.fasterxml.jackson.databind.util.ClassUtil; import com.hubspot.rosetta.annotations.RosettaCreator; +import com.hubspot.rosetta.annotations.RosettaDeserializationProperty; import com.hubspot.rosetta.annotations.RosettaDeserialize; -import com.hubspot.rosetta.annotations.RosettaGetter; import com.hubspot.rosetta.annotations.RosettaIgnore; import com.hubspot.rosetta.annotations.RosettaNaming; import com.hubspot.rosetta.annotations.RosettaProperty; +import com.hubspot.rosetta.annotations.RosettaSerializationProperty; import com.hubspot.rosetta.annotations.RosettaSerialize; -import com.hubspot.rosetta.annotations.RosettaSetter; import com.hubspot.rosetta.annotations.RosettaValue; import com.hubspot.rosetta.annotations.StoredAsJson; import java.util.Optional; @@ -182,7 +182,7 @@ private Optional findRosettaPropertyName(Annotated a) { private Optional findRosettaGetterName(Annotated a) { return Optional - .ofNullable(a.getAnnotation(RosettaGetter.class)) + .ofNullable(a.getAnnotation(RosettaSerializationProperty.class)) .map(annotation -> annotation.value().isEmpty() ? PropertyName.USE_DEFAULT @@ -192,7 +192,7 @@ private Optional findRosettaGetterName(Annotated a) { private Optional findRosettaSetterName(Annotated a) { return Optional - .ofNullable(a.getAnnotation(RosettaSetter.class)) + .ofNullable(a.getAnnotation(RosettaDeserializationProperty.class)) .map(annotation -> annotation.value().isEmpty() ? PropertyName.USE_DEFAULT diff --git a/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaGetterBean.java b/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaGetterBean.java index 2dbbde9..10a9869 100644 --- a/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaGetterBean.java +++ b/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaGetterBean.java @@ -2,19 +2,19 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.hubspot.rosetta.annotations.RosettaGetter; +import com.hubspot.rosetta.annotations.RosettaSerializationProperty; public class RosettaGetterBean { - @RosettaGetter("mccartney_song_title") + @RosettaSerializationProperty("mccartney_song_title") private String mcCartneySongTitle; - @RosettaGetter + @RosettaSerializationProperty @JsonIgnore private String jsonIgnoreRosettaUse; @JsonProperty("otherValue") - @RosettaGetter("other_value") + @RosettaSerializationProperty("other_value") private String someOtherValue; public String getMcCartneySongTitle() { diff --git a/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaSetterBean.java b/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaSetterBean.java index 1df7924..8bb6d16 100644 --- a/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaSetterBean.java +++ b/RosettaCore/src/test/java/com/hubspot/rosetta/beans/RosettaSetterBean.java @@ -2,19 +2,19 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.hubspot.rosetta.annotations.RosettaSetter; +import com.hubspot.rosetta.annotations.RosettaDeserializationProperty; public class RosettaSetterBean { - @RosettaSetter("mccartney_song_title") + @RosettaDeserializationProperty("mccartney_song_title") private String mcCartneySongTitle; - @RosettaSetter + @RosettaDeserializationProperty @JsonIgnore private String jsonIgnoreRosettaUse; @JsonProperty("otherValue") - @RosettaSetter("other_value") + @RosettaDeserializationProperty("other_value") private String someOtherValue; public String getMcCartneySongTitle() {