Class ImmutableMavenProtocPlugin

java.lang.Object
io.github.ascopes.protobufmavenplugin.plugins.ImmutableMavenProtocPlugin
All Implemented Interfaces:
MavenArtifact, MavenProtocPlugin, ProtocPlugin

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableMavenProtocPlugin extends Object implements MavenProtocPlugin
Immutable implementation of MavenProtocPlugin.

Use the builder to create immutable instances: ImmutableMavenProtocPlugin.builder().

  • Field Details

    • groupId

      private final String groupId
    • artifactId

      private final String artifactId
    • type

      private final @Nullable String type
    • classifier

      private final @Nullable String classifier
    • exclusions

      private final Set<MavenExclusionBean> exclusions
    • options

      private final @Nullable String options
    • order

      private final int order
    • isSkip

      private final boolean isSkip
    • version

      private final @NonNull String version
    • jvmArgs

      private final @Nullable List<String> jvmArgs
    • dependencyResolutionDepth

      private final transient @Nullable DependencyResolutionDepth dependencyResolutionDepth
    • jvmConfigArgs

      private final @Nullable List<String> jvmConfigArgs
    • mainClass

      private final @Nullable String mainClass
    • STAGE_INITIALIZING

      private static final byte STAGE_INITIALIZING
      See Also:
    • STAGE_UNINITIALIZED

      private static final byte STAGE_UNINITIALIZED
      See Also:
    • STAGE_INITIALIZED

      private static final byte STAGE_INITIALIZED
      See Also:
    • initShim

      private transient volatile ImmutableMavenProtocPlugin.InitShim initShim
  • Constructor Details

  • Method Details

    • getOrderInitialize

      private int getOrderInitialize()
    • isSkipInitialize

      private boolean isSkipInitialize()
    • getDependencyResolutionDepthInitialize

      private @Nullable DependencyResolutionDepth getDependencyResolutionDepthInitialize()
    • getGroupId

      public String getGroupId()
      Get the group ID.
      Specified by:
      getGroupId in interface MavenArtifact
      Returns:
      the group ID.
    • getArtifactId

      public String getArtifactId()
      Get the artifact ID.
      Specified by:
      getArtifactId in interface MavenArtifact
      Returns:
      the artifact ID.
    • getType

      public @Nullable String getType()
      Get the artifact type.

      May be null if the default should be used.

      Specified by:
      getType in interface MavenArtifact
      Returns:
      the artifact type.
    • getClassifier

      public @Nullable String getClassifier()
      Get the artifact classifier.

      May be null if no classifier is set.

      Specified by:
      getClassifier in interface MavenArtifact
      Returns:
      the artifact classifier.
    • getExclusions

      public Set<MavenExclusionBean> getExclusions()
      Get a set of dependency exclusions to apply when resolving dependencies.
      Specified by:
      getExclusions in interface MavenArtifact
      Returns:
      the exclusions, which by default is empty.
    • getOptions

      public @Nullable String getOptions()
      Specified by:
      getOptions in interface ProtocPlugin
      Returns:
      The value of the options attribute
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface ProtocPlugin
      Returns:
      The value of the order attribute
    • isSkip

      public boolean isSkip()
      Specified by:
      isSkip in interface ProtocPlugin
      Returns:
      The value of the isSkip attribute
    • getVersion

      public @NonNull String getVersion()
      Get the version of the protoc plugin.

      This must be specified for plugins.

      Specified by:
      getVersion in interface MavenArtifact
      Specified by:
      getVersion in interface MavenProtocPlugin
      Returns:
      the protoc plugin version to use.
    • getJvmArgs

      public @Nullable List<String> getJvmArgs()
      Get the command line arguments to pass to the JVM.

      This defaults to an empty list.

      Specified by:
      getJvmArgs in interface MavenProtocPlugin
      Returns:
      the list of command line arguments to pass to the JVM.
      Since:
      2.6.0
    • getDependencyResolutionDepth

      public @Nullable DependencyResolutionDepth getDependencyResolutionDepth()
      The dependency resolution depth.

      This cannot be changed for this type of plugin.

      Specified by:
      getDependencyResolutionDepth in interface MavenArtifact
      Specified by:
      getDependencyResolutionDepth in interface MavenProtocPlugin
      Returns:
      null, always.
    • getJvmConfigArgs

      public @Nullable List<String> getJvmConfigArgs()
      Get the arguments to pass to the JVM to configure it.

      Users can use this to control concerns such as heap memory controls, GC and JIT settings, and specifying additional JVM options.

      Specified by:
      getJvmConfigArgs in interface MavenProtocPlugin
      Returns:
      the list of command line arguments to pass to the JVM.
      Since:
      2.6.0
    • getMainClass

      public @Nullable String getMainClass()
      The main class entrypoint to use if the plugin is not an assembled JAR.

      Ignored in all other cases.

      Specified by:
      getMainClass in interface MavenProtocPlugin
      Returns:
      the main class name.
      Since:
      2.5.0
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMavenProtocPlugin that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableMavenProtocPlugin another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: groupId, artifactId, type, classifier, exclusions, options, order, isSkip, version, jvmArgs, dependencyResolutionDepth, jvmConfigArgs, mainClass.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value MavenProtocPlugin with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • builder

      public static ImmutableMavenProtocPlugin.Builder builder()
      Creates a builder for ImmutableMavenProtocPlugin.
       ImmutableMavenProtocPlugin.builder()
          .groupId(String | null) // nullable groupId
          .artifactId(String | null) // nullable artifactId
          .type(@org.jspecify.annotations.Nullable String | null) // nullable type
          .classifier(@org.jspecify.annotations.Nullable String | null) // nullable classifier
          .addExclusions|addAllExclusions(MavenExclusionBean) // exclusions elements
          .options(@org.jspecify.annotations.Nullable String | null) // nullable options
          .order(int) // optional order
          .isSkip(boolean) // optional isSkip
          .version(@org.jspecify.annotations.NonNull String | null) // nullable version
          .jvmArgs(@org.jspecify.annotations.Nullable List&lt;String&gt; | null) // nullable jvmArgs
          .jvmConfigArgs(@org.jspecify.annotations.Nullable List&lt;String&gt; | null) // nullable jvmConfigArgs
          .mainClass(@org.jspecify.annotations.Nullable String | null) // nullable mainClass
          .build();
       
      Returns:
      A new ImmutableMavenProtocPlugin builder
    • createSafeList

      private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls)
    • createUnmodifiableList

      private static <T> List<T> createUnmodifiableList(boolean clone, List<T> list)
    • createUnmodifiableSet

      private static <T> Set<T> createUnmodifiableSet(List<T> list)
      Unmodifiable set constructed from list to avoid rehashing.