Class Snapshot

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

@Experimental @Generated @ThreadSafe @Immutable public class Snapshot extends Object implements Serializable
Snapshot data for the last artifact corresponding to the SNAPSHOT base version
See Also:
  • Method Details

    • getTimestamp

      public String getTimestamp()
      The timestamp when this version was deployed. The timestamp is expressed using UTC in the format yyyyMMdd.HHmmss.
      Returns:
      a String
    • getBuildNumber

      public int getBuildNumber()
      The incremental build number
      Returns:
      a int
    • isLocalCopy

      public boolean isLocalCopy()
      Whether to use a local copy instead (with filename that includes the base version)
      Returns:
      a boolean
    • with

      @Nonnull public Snapshot.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withTimestamp

      @Nonnull public Snapshot withTimestamp(String timestamp)
      Creates a new Snapshot instance using the specified timestamp.
      Parameters:
      timestamp - the new String to use
      Returns:
      a Snapshot with the specified timestamp
    • withBuildNumber

      @Nonnull public Snapshot withBuildNumber(int buildNumber)
      Creates a new Snapshot instance using the specified buildNumber.
      Parameters:
      buildNumber - the new int to use
      Returns:
      a Snapshot with the specified buildNumber
    • withLocalCopy

      @Nonnull public Snapshot withLocalCopy(boolean localCopy)
      Creates a new Snapshot instance using the specified localCopy.
      Parameters:
      localCopy - the new boolean to use
      Returns:
      a Snapshot with the specified localCopy
    • newInstance

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

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

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

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

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