Package org.apache.maven.api.model
Class ActivationFile
java.lang.Object
org.apache.maven.api.model.ActivationFile
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class ActivationFile
extends Object
implements Serializable, InputLocationTracker
This is the file specification used to activate the profile. The
missing
value
is the location of a file that needs to exist, and if it doesn't, the profile will be
activated. On the other hand, exists
will test for the existence of the file and if it is
there, the profile will be activated.
Variable interpolation for these file specifications is limited to ${project.basedir}
,
system properties and user properties.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create ActivationFile instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
ActivationFile
(ActivationFile.Builder builder) Constructor for this class, to be called from its subclasses andActivationFile.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionThe name of the file that must exist to activate the profile.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.The name of the file that must be missing to activate the profile.static ActivationFile.Builder
Creates a newActivationFile
builder instance.static ActivationFile.Builder
newBuilder
(boolean withDefaults) Creates a newActivationFile
builder instance using default values or not.static ActivationFile.Builder
newBuilder
(ActivationFile from) Creates a newActivationFile
builder instance using the specified object as a basis.static ActivationFile.Builder
newBuilder
(ActivationFile from, boolean forceCopy) Creates a newActivationFile
builder instance using the specified object as a basis.static ActivationFile
Creates a newActivationFile
instance.static ActivationFile
newInstance
(boolean withDefaults) Creates a newActivationFile
instance using default values or not.with()
Creates a new builder with this object as the basis.withExists
(String exists) Creates a newActivationFile
instance using the specified exists.withMissing
(String missing) Creates a newActivationFile
instance using the specified missing.
-
Constructor Details
-
ActivationFile
Constructor for this class, to be called from its subclasses andActivationFile.Builder
.- See Also:
-
-
Method Details
-
getMissing
The name of the file that must be missing to activate the profile. Please note, that missing and exists fields cannot be used together. Only one of them should be used at any one time.- Returns:
- a
String
-
getExists
The name of the file that must exist to activate the profile. Please note, that missing and exists fields cannot be used together. Only one of them should be used at any one time.- 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
-
withMissing
Creates a newActivationFile
instance using the specified missing.- Parameters:
missing
- the newString
to use- Returns:
- a
ActivationFile
with the specified missing
-
withExists
Creates a newActivationFile
instance using the specified exists.- Parameters:
exists
- the newString
to use- Returns:
- a
ActivationFile
with the specified exists
-
newInstance
Creates a newActivationFile
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
ActivationFile
- See Also:
-
newInstance
Creates a newActivationFile
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
ActivationFile
-
newBuilder
Creates a newActivationFile
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newActivationFile
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 newActivationFile
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theActivationFile
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newActivationFile
builder instance using the specified object as a basis.- Parameters:
from
- theActivationFile
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-