Package org.apache.maven.api.model
Class Relocation
java.lang.Object
org.apache.maven.api.model.Relocation
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Relocation
extends Object
implements Serializable, InputLocationTracker
Describes where an artifact has moved to. If any of the values are omitted, it is
assumed to be the same as it was before.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Relocation instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
Relocation
(Relocation.Builder builder) Constructor for this class, to be called from its subclasses andRelocation.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionThe new artifact ID of the artifact.The group ID the artifact has moved to.Gets the input location that caused this model to be read.getLocation
(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.An additional message to show the user about the move, such as the reason.The new version of the artifact.static Relocation.Builder
Creates a newRelocation
builder instance.static Relocation.Builder
newBuilder
(boolean withDefaults) Creates a newRelocation
builder instance using default values or not.static Relocation.Builder
newBuilder
(Relocation from) Creates a newRelocation
builder instance using the specified object as a basis.static Relocation.Builder
newBuilder
(Relocation from, boolean forceCopy) Creates a newRelocation
builder instance using the specified object as a basis.static Relocation
Creates a newRelocation
instance.static Relocation
newInstance
(boolean withDefaults) Creates a newRelocation
instance using default values or not.with()
Creates a new builder with this object as the basis.withArtifactId
(String artifactId) Creates a newRelocation
instance using the specified artifactId.withGroupId
(String groupId) Creates a newRelocation
instance using the specified groupId.withMessage
(String message) Creates a newRelocation
instance using the specified message.withVersion
(String version) Creates a newRelocation
instance using the specified version.
-
Constructor Details
-
Relocation
Constructor for this class, to be called from its subclasses andRelocation.Builder
.- See Also:
-
-
Method Details
-
getGroupId
The group ID the artifact has moved to.- Returns:
- a
String
-
getArtifactId
The new artifact ID of the artifact.- Returns:
- a
String
-
getVersion
The new version of the artifact.- Returns:
- a
String
-
getMessage
An additional message to show the user about the move, such as the reason.- Returns:
- a
String
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
-
getLocationKeys
Gets the keys of the locations of the input source. -
getLocationKeyStream
-
getImportedFrom
Gets the input location that caused this model to be read.- Specified by:
getImportedFrom
in interfaceInputLocationTracker
- Returns:
- InputLocation
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withGroupId
Creates a newRelocation
instance using the specified groupId.- Parameters:
groupId
- the newString
to use- Returns:
- a
Relocation
with the specified groupId
-
withArtifactId
Creates a newRelocation
instance using the specified artifactId.- Parameters:
artifactId
- the newString
to use- Returns:
- a
Relocation
with the specified artifactId
-
withVersion
Creates a newRelocation
instance using the specified version.- Parameters:
version
- the newString
to use- Returns:
- a
Relocation
with the specified version
-
withMessage
Creates a newRelocation
instance using the specified message.- Parameters:
message
- the newString
to use- Returns:
- a
Relocation
with the specified message
-
newInstance
Creates a newRelocation
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Relocation
- See Also:
-
newInstance
Creates a newRelocation
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Relocation
-
newBuilder
Creates a newRelocation
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newRelocation
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 newRelocation
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theRelocation
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newRelocation
builder instance using the specified object as a basis.- Parameters:
from
- theRelocation
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-