Class Versioning

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

@Experimental @Generated @ThreadSafe @Immutable public class Versioning extends Object implements Serializable
Versioning information for "groupId/artifactId" or "groupId/artifactId/version" SNAPSHOT
See Also:
  • Method Details

    • getLatest

      public String getLatest()
      What the last version added to the directory is, including both releases and snapshots ("groupId/artifactId" directory only)
      Returns:
      a String
    • getRelease

      public String getRelease()
      What the last version added to the directory is, for the releases only ("groupId/artifactId" directory only)
      Returns:
      a String
    • getVersions

      @Nonnull public List<String> getVersions()
      Versions available of the artifact (both releases and snapshots) ("groupId/artifactId" directory only)
      Returns:
      a List<String>
    • getLastUpdated

      public String getLastUpdated()
      When the metadata was last updated (both "groupId/artifactId" and "groupId/artifactId/version" directories). The timestamp is expressed using UTC in the format yyyyMMddHHmmss.
      Returns:
      a String
    • getSnapshot

      public Snapshot getSnapshot()
      The current snapshot data in use for this version ("groupId/artifactId/version" only)
      Returns:
      a Snapshot
    • getSnapshotVersions

      @Nonnull public List<SnapshotVersion> getSnapshotVersions()
      Information for each sub-artifact available in this artifact snapshot. This is only the most recent SNAPSHOT for each unique extension/classifier combination.
      Returns:
      a List<SnapshotVersion>
    • with

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

      @Nonnull public Versioning withLatest(String latest)
      Creates a new Versioning instance using the specified latest.
      Parameters:
      latest - the new String to use
      Returns:
      a Versioning with the specified latest
    • withRelease

      @Nonnull public Versioning withRelease(String release)
      Creates a new Versioning instance using the specified release.
      Parameters:
      release - the new String to use
      Returns:
      a Versioning with the specified release
    • withVersions

      @Nonnull public Versioning withVersions(Collection<String> versions)
      Creates a new Versioning instance using the specified versions.
      Parameters:
      versions - the new Collection<String> to use
      Returns:
      a Versioning with the specified versions
    • withLastUpdated

      @Nonnull public Versioning withLastUpdated(String lastUpdated)
      Creates a new Versioning instance using the specified lastUpdated.
      Parameters:
      lastUpdated - the new String to use
      Returns:
      a Versioning with the specified lastUpdated
    • withSnapshot

      @Nonnull public Versioning withSnapshot(Snapshot snapshot)
      Creates a new Versioning instance using the specified snapshot.
      Parameters:
      snapshot - the new Snapshot to use
      Returns:
      a Versioning with the specified snapshot
    • withSnapshotVersions

      @Nonnull public Versioning withSnapshotVersions(Collection<SnapshotVersion> snapshotVersions)
      Creates a new Versioning instance using the specified snapshotVersions.
      Parameters:
      snapshotVersions - the new Collection<SnapshotVersion> to use
      Returns:
      a Versioning with the specified snapshotVersions
    • newInstance

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

      @Nonnull public static Versioning newInstance(boolean withDefaults)
      Creates a new Versioning 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 Versioning
    • newBuilder

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

      @Nonnull public static Versioning.Builder newBuilder(boolean withDefaults)
      Creates a new Versioning 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 Versioning.Builder newBuilder(Versioning from)
      Creates a new Versioning builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Versioning instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

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