Class SnapshotVersion

java.lang.Object
org.apache.maven.api.metadata.SnapshotVersion
All Implemented Interfaces:
Serializable

@Experimental @Generated @ThreadSafe @Immutable public class SnapshotVersion extends Object implements Serializable
Versioning information for a sub-artifact of the current snapshot artifact.
See Also:
  • Constructor Details

  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getClassifier

      public String getClassifier()
      The classifier of the sub-artifact. Each classifier and extension pair may only appear once.
      Returns:
      a String
    • getExtension

      public String getExtension()
      The file extension of the sub-artifact. Each classifier and extension pair may only appear once.
      Returns:
      a String
    • getVersion

      public String getVersion()
      The resolved snapshot version of the sub-artifact.
      Returns:
      a String
    • getUpdated

      public String getUpdated()
      The timestamp when this version information was last updated. The timestamp is expressed using UTC in the format yyyyMMddHHmmss.
      Returns:
      a String
    • with

      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withClassifier

      @Nonnull public SnapshotVersion withClassifier(String classifier)
      Creates a new SnapshotVersion instance using the specified classifier.
      Parameters:
      classifier - the new String to use
      Returns:
      a SnapshotVersion with the specified classifier
    • withExtension

      @Nonnull public SnapshotVersion withExtension(String extension)
      Creates a new SnapshotVersion instance using the specified extension.
      Parameters:
      extension - the new String to use
      Returns:
      a SnapshotVersion with the specified extension
    • withVersion

      @Nonnull public SnapshotVersion withVersion(String version)
      Creates a new SnapshotVersion instance using the specified version.
      Parameters:
      version - the new String to use
      Returns:
      a SnapshotVersion with the specified version
    • withUpdated

      @Nonnull public SnapshotVersion withUpdated(String updated)
      Creates a new SnapshotVersion instance using the specified updated.
      Parameters:
      updated - the new String to use
      Returns:
      a SnapshotVersion with the specified updated
    • newInstance

      @Nonnull public static SnapshotVersion newInstance()
      Creates a new SnapshotVersion instance. Equivalent to newInstance(true).
      Returns:
      a new SnapshotVersion
      See Also:
    • newInstance

      @Nonnull public static SnapshotVersion newInstance(boolean withDefaults)
      Creates a new SnapshotVersion instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new SnapshotVersion
    • newBuilder

      @Nonnull public static SnapshotVersion.Builder newBuilder()
      Creates a new SnapshotVersion builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static SnapshotVersion.Builder newBuilder(boolean withDefaults)
      Creates a new SnapshotVersion builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static SnapshotVersion.Builder newBuilder(SnapshotVersion from)
      Creates a new SnapshotVersion builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the SnapshotVersion instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static SnapshotVersion.Builder newBuilder(SnapshotVersion from, boolean forceCopy)
      Creates a new SnapshotVersion builder instance using the specified object as a basis.
      Parameters:
      from - the SnapshotVersion instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder