Class MavenArtifactBean

java.lang.Object
io.github.ascopes.protobufmavenplugin.dependencies.MavenArtifactBean
All Implemented Interfaces:
MavenArtifact

@Generated({"Modifiables.generator","MavenArtifact"}) public class MavenArtifactBean extends Object implements MavenArtifact
A modifiable implementation of the MavenArtifact 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.

MavenArtifactBean is not thread-safe

  • Field Details

  • Constructor Details

    • MavenArtifactBean

      public MavenArtifactBean()
  • 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.
    • getVersion

      public @Nullable String getVersion()
      Get the artifact version.

      May be null if we expect to discover the version from dependency management.

      Specified by:
      getVersion in interface MavenArtifact
      Returns:
      the version.
    • 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.
    • getDependencyResolutionDepth

      public @Nullable DependencyResolutionDepth getDependencyResolutionDepth()
      Get the preferences for the depth of dependency resolution.

      May be null if the default should be used.

      Specified by:
      getDependencyResolutionDepth in interface MavenArtifact
      Returns:
      the preference for the depth of dependency resolution.
    • 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.
    • clear

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

      public MavenArtifactBean from(MavenArtifact instance)
      Fill this modifiable instance with attribute values from the provided MavenArtifact 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

      public MavenArtifactBean from(MavenArtifactBean instance)
      Fill this modifiable instance with attribute values from the provided MavenArtifact 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
    • 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
    • setVersion

      public void setVersion(@Nullable String version)
      Assigns a value to the version attribute.
      Parameters:
      version - The value for version, 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
    • setDependencyResolutionDepth

      public void setDependencyResolutionDepth(@Nullable DependencyResolutionDepth dependencyResolutionDepth)
      Assigns a value to the dependencyResolutionDepth attribute.
      Parameters:
      dependencyResolutionDepth - The value for dependencyResolutionDepth, 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
    • 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
    • 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
    • unsetGroupId

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

      public final void unsetArtifactId()
      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()
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of MavenArtifactBean 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(MavenArtifactBean another)
    • hashCode

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

      public String toString()
      Generates a string representation of this MavenArtifact. 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)
    • createUnmodifiableSet

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