Class MavenProtocPluginBean

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

@Generated({"Modifiables.generator","MavenProtocPlugin"}) public class MavenProtocPluginBean extends Object implements MavenProtocPlugin
A modifiable implementation of the MavenProtocPlugin type.

Use the constructor to create new modifiable instances. You may even extend this class to add some convenience methods, however most of the methods in this class are final to preserve safety and predictable invariants.

MavenProtocPluginBean is not thread-safe

See Also:
  • Field Details

    • INIT_BIT_GROUP_ID

      private static final long INIT_BIT_GROUP_ID
      See Also:
    • INIT_BIT_ARTIFACT_ID

      private static final long INIT_BIT_ARTIFACT_ID
      See Also:
    • INIT_BIT_VERSION

      private static final long INIT_BIT_VERSION
      See Also:
    • OPT_BIT_ORDER

      private static final long OPT_BIT_ORDER
      See Also:
    • OPT_BIT_IS_SKIP

      private static final long OPT_BIT_IS_SKIP
      See Also:
    • initBits

      private long initBits
    • optBits

      private long optBits
    • groupId

      private String groupId
    • artifactId

      private String artifactId
    • type

      private @Nullable String type
    • classifier

      private @Nullable String classifier
    • exclusions

      private Set<MavenExclusionBean> exclusions
    • options

      private @Nullable String options
    • order

      private int order
    • isSkip

      private boolean isSkip
    • version

      private @NonNull String version
    • jvmArgs

      private List<String> jvmArgs
    • jvmConfigArgs

      private List<String> jvmConfigArgs
    • mainClass

      private @Nullable String mainClass
  • Constructor Details

    • MavenProtocPluginBean

      public MavenProtocPluginBean()
  • Method Details

    • 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:
      value of options attribute, may be null
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface ProtocPlugin
      Returns:
      assigned or, otherwise, newly computed, not cached value of order attribute
    • isSkip

      public boolean isSkip()
      Specified by:
      isSkip in interface ProtocPlugin
      Returns:
      assigned or, otherwise, newly computed, not cached value of 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
    • clear

      public void clear()
      Clears the object by setting all attributes to their initial values.
    • from

      public MavenProtocPluginBean from(MavenProtocPlugin instance)
      Fill this modifiable instance with attribute values from the provided MavenProtocPlugin instance.
      Parameters:
      instance - The instance from which to copy values
    • from

      public MavenProtocPluginBean from(ProtocPlugin instance)
      Fill this modifiable instance with attribute values from the provided ProtocPlugin instance.
      Parameters:
      instance - The instance from which to copy values
    • from

      public MavenProtocPluginBean from(MavenArtifact instance)
      Fill this modifiable instance with attribute values from the provided MavenArtifact instance.
      Parameters:
      instance - The instance from which to copy values
    • from

      Fill this modifiable instance with attribute values from the provided MavenProtocPlugin instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this for use in a chained invocation
    • from

      private void from(Object object)
    • setGroupId

      public void setGroupId(String groupId)
      Assigns a value to the groupId attribute.
      Parameters:
      groupId - The value for groupId, can be null
    • setArtifactId

      public void setArtifactId(String artifactId)
      Assigns a value to the artifactId attribute.
      Parameters:
      artifactId - The value for artifactId, can be null
    • setType

      public void setType(@Nullable String type)
      Assigns a value to the type attribute.
      Parameters:
      type - The value for type, can be null
    • setClassifier

      public void setClassifier(@Nullable String classifier)
      Assigns a value to the classifier attribute.
      Parameters:
      classifier - The value for classifier, can be null
    • addExclusions

      public void addExclusions(MavenExclusionBean element)
      Adds one element to exclusions set.
      Parameters:
      element - The exclusions element
    • addExclusions

      public final void addExclusions(MavenExclusionBean... elements)
      Adds elements to exclusions set.
      Parameters:
      elements - An array of exclusions elements
    • setExclusions

      public void setExclusions(Set<MavenExclusionBean> elements)
      Sets or replaces all elements for exclusions set.
      Parameters:
      elements - An iterable of exclusions elements
    • addAllExclusions

      public void addAllExclusions(Iterable<? extends MavenExclusionBean> elements)
      Adds elements to exclusions set.
      Parameters:
      elements - An iterable of exclusions elements
    • setOptions

      public void setOptions(@Nullable String options)
      Assigns a value to the options attribute.
      Parameters:
      options - The value for options, can be null
    • setOrder

      public void setOrder(int order)
      Assigns a value to the order attribute.

      If not set, this attribute will have a default value returned by the initializer of order.

      Parameters:
      order - The value for order
    • setIsSkip

      public void setIsSkip(boolean isSkip)
      Assigns a value to the isSkip attribute.

      If not set, this attribute will have a default value returned by the initializer of isSkip.

      Parameters:
      isSkip - The value for isSkip
    • setVersion

      public void setVersion(@NonNull String version)
      Assigns a value to the version attribute.
      Parameters:
      version - The value for version, can be null
    • addJvmArgs

      public void addJvmArgs(String element)
      Adds one element to jvmArgs list.
      Parameters:
      element - The jvmArgs element
    • addJvmArgs

      public final void addJvmArgs(String... elements)
      Adds elements to jvmArgs list.
      Parameters:
      elements - An array of jvmArgs elements
    • setJvmArgs

      public void setJvmArgs(@Nullable List<String> elements)
      Sets or replaces all elements for jvmArgs list.
      Parameters:
      elements - An iterable of jvmArgs elements, can be null
    • addAllJvmArgs

      public void addAllJvmArgs(Iterable<String> elements)
      Adds elements to jvmArgs list.
      Parameters:
      elements - An iterable of jvmArgs elements
    • addJvmConfigArgs

      public void addJvmConfigArgs(String element)
      Adds one element to jvmConfigArgs list.
      Parameters:
      element - The jvmConfigArgs element
    • addJvmConfigArgs

      public final void addJvmConfigArgs(String... elements)
      Adds elements to jvmConfigArgs list.
      Parameters:
      elements - An array of jvmConfigArgs elements
    • setJvmConfigArgs

      public void setJvmConfigArgs(@Nullable List<String> elements)
      Sets or replaces all elements for jvmConfigArgs list.
      Parameters:
      elements - An iterable of jvmConfigArgs elements, can be null
    • addAllJvmConfigArgs

      public void addAllJvmConfigArgs(Iterable<String> elements)
      Adds elements to jvmConfigArgs list.
      Parameters:
      elements - An iterable of jvmConfigArgs elements
    • setMainClass

      public void setMainClass(@Nullable String mainClass)
      Assigns a value to the mainClass attribute.
      Parameters:
      mainClass - The value for mainClass, can be null
    • groupIdIsSet

      public final boolean groupIdIsSet()
      Returns true if the required attribute groupId is set.
      Returns:
      true if set
    • artifactIdIsSet

      public final boolean artifactIdIsSet()
      Returns true if the required attribute artifactId is set.
      Returns:
      true if set
    • versionIsSet

      public final boolean versionIsSet()
      Returns true if the required attribute version is set.
      Returns:
      true if set
    • orderIsSet

      public final boolean orderIsSet()
      Returns true if the default attribute order is set.
      Returns:
      true if set
    • isSkipIsSet

      public final boolean isSkipIsSet()
      Returns true if the default attribute isSkip is set.
      Returns:
      true if set
    • exclusionsIsSet

      public final boolean exclusionsIsSet()
      Returns true if the exclusions has not been initialized and will default to an empty set.
      Returns:
      true if set
    • jvmArgsIsSet

      public final boolean jvmArgsIsSet()
      Returns true if the jvmArgs has not been initialized and will default to an empty list.
      Returns:
      true if set
    • jvmConfigArgsIsSet

      public final boolean jvmConfigArgsIsSet()
      Returns true if the jvmConfigArgs has not been initialized and will default to an empty list.
      Returns:
      true if set
    • unsetGroupId

      public final void unsetGroupId()
      Reset an attribute to its initial value.
    • unsetArtifactId

      public final void unsetArtifactId()
      Reset an attribute to its initial value.
    • unsetVersion

      public final void unsetVersion()
      Reset an attribute to its initial value.
    • unsetOrder

      public final void unsetOrder()
      Reset an attribute to its initial value.
    • unsetIsSkip

      public final void unsetIsSkip()
      Reset an attribute to its initial value.
    • isInitialized

      public final boolean isInitialized()
      Returns true if all required attributes are set, indicating that the object is initialized.
      Returns:
      true if set
    • checkRequiredAttributes

      private void checkRequiredAttributes()
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()
    • toImmutable

      public final ImmutableMavenProtocPlugin toImmutable()
      Returns:
      An immutable instance of MavenProtocPlugin
    • equals

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

      private boolean equalTo(MavenProtocPluginBean 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()
      Generates a string representation of this MavenProtocPlugin. If uninitialized, some attribute values may appear as question marks.
      Overrides:
      toString in class Object
      Returns:
      A string representation
    • 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.