Class Snapshot
java.lang.Object
org.apache.maven.artifact.repository.metadata.v4.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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Snapshot instances. -
Method Summary
Modifier and TypeMethodDescriptionint
The incremental build numberThe timestamp when this version was deployed.boolean
Whether to use a local copy instead (with filename that includes the base version)static Snapshot.Builder
Creates a newSnapshot
builder instance.static Snapshot.Builder
newBuilder
(boolean withDefaults) Creates a newSnapshot
builder instance using default values or not.static Snapshot.Builder
newBuilder
(Snapshot from) Creates a newSnapshot
builder instance using the specified object as a basis.static Snapshot.Builder
newBuilder
(Snapshot from, boolean forceCopy) Creates a newSnapshot
builder instance using the specified object as a basis.static Snapshot
Creates a newSnapshot
instance.static Snapshot
newInstance
(boolean withDefaults) Creates a newSnapshot
instance using default values or not.with()
Creates a new builder with this object as the basis.withBuildNumber
(int buildNumber) Creates a newSnapshot
instance using the specified buildNumber.withLocalCopy
(boolean localCopy) Creates a newSnapshot
instance using the specified localCopy.withTimestamp
(String timestamp) Creates a newSnapshot
instance using the specified timestamp.
-
Method Details
-
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
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withTimestamp
Creates a newSnapshot
instance using the specified timestamp.- Parameters:
timestamp
- the newString
to use- Returns:
- a
Snapshot
with the specified timestamp
-
withBuildNumber
Creates a newSnapshot
instance using the specified buildNumber.- Parameters:
buildNumber
- the newint
to use- Returns:
- a
Snapshot
with the specified buildNumber
-
withLocalCopy
Creates a newSnapshot
instance using the specified localCopy.- Parameters:
localCopy
- the newboolean
to use- Returns:
- a
Snapshot
with the specified localCopy
-
newInstance
Creates a newSnapshot
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Snapshot
- See Also:
-
newInstance
Creates a newSnapshot
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Snapshot
-
newBuilder
Creates a newSnapshot
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newSnapshot
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newSnapshot
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theSnapshot
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newSnapshot
builder instance using the specified object as a basis.- Parameters:
from
- theSnapshot
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-