From a0413fd82afea04f8bdd19ee7651057f7ff21fd8 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 3 Dec 2024 13:01:08 -0500 Subject: [PATCH] Remove hubspot-style and immutables-exceptions dependencies --- pom.xml | 20 --------------- .../interpret/ContextConfigurationIF.java | 6 ++--- .../jinjava/style/JinjavaImmutableStyle.java | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/hubspot/jinjava/style/JinjavaImmutableStyle.java diff --git a/pom.xml b/pom.xml index 7a46ed2ec..a51094348 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,6 @@ 0.8.3 3.0.1 - 1.9 @@ -91,16 +90,6 @@ jackson-datatype-jdk8 2.14.0 - - com.hubspot.immutables - hubspot-style - ${dep.hubspot-immutables.version} - - - com.hubspot.immutables - immutables-exceptions - ${dep.hubspot-immutables.version} - @@ -204,15 +193,6 @@ value provided - - com.hubspot.immutables - hubspot-style - provided - - - com.hubspot.immutables - immutables-exceptions - diff --git a/src/main/java/com/hubspot/jinjava/interpret/ContextConfigurationIF.java b/src/main/java/com/hubspot/jinjava/interpret/ContextConfigurationIF.java index daefd5981..79e95d303 100644 --- a/src/main/java/com/hubspot/jinjava/interpret/ContextConfigurationIF.java +++ b/src/main/java/com/hubspot/jinjava/interpret/ContextConfigurationIF.java @@ -1,14 +1,14 @@ package com.hubspot.jinjava.interpret; -import com.hubspot.immutables.style.HubSpotImmutableStyle; import com.hubspot.jinjava.lib.expression.DefaultExpressionStrategy; import com.hubspot.jinjava.lib.expression.ExpressionStrategy; +import com.hubspot.jinjava.style.JinjavaImmutableStyle; import javax.annotation.Nullable; import org.immutables.value.Value.Default; import org.immutables.value.Value.Immutable; @Immutable(singleton = true) -@HubSpotImmutableStyle +@JinjavaImmutableStyle public interface ContextConfigurationIF { @Default default ExpressionStrategy getExpressionStrategy() { @@ -49,7 +49,7 @@ default ErrorHandlingStrategy getErrorHandlingStrategy() { } @Immutable(singleton = true) - @HubSpotImmutableStyle + @JinjavaImmutableStyle interface ErrorHandlingStrategyIF { @Default default TemplateErrorTypeHandlingStrategy getFatalErrorStrategy() { diff --git a/src/main/java/com/hubspot/jinjava/style/JinjavaImmutableStyle.java b/src/main/java/com/hubspot/jinjava/style/JinjavaImmutableStyle.java new file mode 100644 index 000000000..ec8d76887 --- /dev/null +++ b/src/main/java/com/hubspot/jinjava/style/JinjavaImmutableStyle.java @@ -0,0 +1,25 @@ +package com.hubspot.jinjava.style; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.immutables.value.Value.Style; +import org.immutables.value.Value.Style.ImplementationVisibility; + +@Target({ ElementType.PACKAGE, ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@JsonSerialize +@Style( + get = { "is*", "get*" }, + init = "set*", + typeAbstract = { "Abstract*", "*IF" }, + typeImmutable = "*", + optionalAcceptNullable = true, + forceJacksonPropertyNames = false, + visibility = ImplementationVisibility.SAME, + redactedMask = "**REDACTED**" +) +public @interface JinjavaImmutableStyle { +}