Package org.apache.maven.artifact
Enum ArtifactScopeEnum
- java.lang.Object
-
- java.lang.Enum<ArtifactScopeEnum>
-
- org.apache.maven.artifact.ArtifactScopeEnum
-
- All Implemented Interfaces:
Serializable
,Comparable<ArtifactScopeEnum>
public enum ArtifactScopeEnum extends Enum<ArtifactScopeEnum>
Type safe reincarnation of Artifact scope. Also supplies theDEFAULT_SCOPE
as well as convenience method to deal with scope relationships.- Author:
- Oleg Gusakov
-
-
Field Summary
Fields Modifier and Type Field Description static ArtifactScopeEnum
DEFAULT_SCOPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ArtifactScopeEnum
checkScope(ArtifactScopeEnum scope)
Helper method to simplify null processingboolean
encloses(ArtifactScopeEnum scope)
scope relationship function.String
getScope()
static ArtifactScopeEnum
valueOf(String name)
Returns the enum constant of this type with the specified name.static ArtifactScopeEnum[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
compile
public static final ArtifactScopeEnum compile
-
test
public static final ArtifactScopeEnum test
-
runtime
public static final ArtifactScopeEnum runtime
-
provided
public static final ArtifactScopeEnum provided
-
system
public static final ArtifactScopeEnum system
-
runtime_plus_system
public static final ArtifactScopeEnum runtime_plus_system
-
-
Field Detail
-
DEFAULT_SCOPE
public static final ArtifactScopeEnum DEFAULT_SCOPE
-
-
Method Detail
-
values
public static ArtifactScopeEnum[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ArtifactScopeEnum c : ArtifactScopeEnum.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ArtifactScopeEnum valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
checkScope
public static ArtifactScopeEnum checkScope(ArtifactScopeEnum scope)
Helper method to simplify null processing
-
getScope
public String getScope()
- Returns:
- unsafe String representation of this scope.
-
encloses
public boolean encloses(ArtifactScopeEnum scope)
scope relationship function. Used by the graph conflict resolution policies- Parameters:
scope
-- Returns:
- true is supplied scope is an inclusive sub-scope of current one.
-
-