public class DependencyBuilder extends Object implements Dependency
Dependency objects. This class implements Dependency for easy consumption. (I.e.:
Use this class wherever you need to create and use a new Dependency)| Modifier | Constructor and Description |
|---|---|
protected |
DependencyBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ExcludedDependencyBuilder |
addExclusion() |
static boolean |
areEquivalent(Dependency l,
Dependency r)
Return true if the groupId and artifactId of the two given dependencies are equal.
|
static DependencyBuilder |
create()
Obtain a new
DependencyBuilder instance. |
static DependencyBuilder |
create(Dependency dep) |
static DependencyBuilder |
create(String identifier) |
boolean |
equals(Object obj) |
String |
getArtifactId()
Get the minor-identifier for this
Dependency. |
String |
getClassifier()
Get the classifier for this
Dependency |
List<Dependency> |
getExcludedDependencies()
Get a list of
Dependency objects to be excluded from this Dependency's list of inclusions when it
is included in a project. |
String |
getGroupId()
Get the major identifier for this
Dependency. |
String |
getPackagingType()
Get the specified packaging type of this
Dependency |
PackagingType |
getPackagingTypeEnum()
Get the
PackagingType of this Dependency, if the type is not one of the default supported types,
PackagingType.OTHER will be returned; |
String |
getScopeType()
Get the scope type of this
Dependency |
ScopeType |
getScopeTypeEnum()
Get the
ScopeType of this Dependency, if the type is not one of the default supported types,
ScopeType.OTHER will be returned; |
String |
getSystemPath()
Get the systemPath of this
Dependency |
String |
getVersion()
Get the version of this
Dependency. |
int |
hashCode() |
boolean |
isSnapshot()
Returns true if this dependency version is a SNAPSHOT
|
DependencyBuilder |
setArtifactId(String artifactId) |
DependencyBuilder |
setClassifier(String classifier) |
DependencyBuilder |
setGroupId(String groupId) |
DependencyBuilder |
setPackagingType(PackagingType type) |
DependencyBuilder |
setPackagingType(String type) |
DependencyBuilder |
setScopeType(ScopeType scope) |
DependencyBuilder |
setScopeType(String scope) |
DependencyBuilder |
setSystemPath(String systemPath) |
DependencyBuilder |
setVersion(String version) |
String |
toCoordinates()
Return a string represenging this dependency in the form of a standard identifier.
|
static String |
toId(Dependency dep)
Convenience method which should be used to convert a
Dependency object into its id representation, for
example: "groupId:artifactId:::version", "groupId:artifactId:packaging::version" or
"groupId:artifactId:packaging:classifier:version" |
String |
toString() |
static String |
toString(Dependency dep)
Convenience method which should be used to convert a
Dependency object into its string representation, for
example: "groupId:artifactId:version:scope:packaging" |
public static DependencyBuilder create()
DependencyBuilder instance.public static DependencyBuilder create(Dependency dep)
public static boolean areEquivalent(Dependency l, Dependency r)
public static DependencyBuilder create(String identifier)
identifier - of the form "groupId:artifactId", "groupId:artifactId:version",
"groupId:artifactId:scope, "groupId
:artifactId:version:scope", "groupId:artifactId:version:scope:packaging"
For classifier specification, see setClassifier(String)public DependencyBuilder setGroupId(String groupId)
public DependencyBuilder setArtifactId(String artifactId)
public DependencyBuilder setVersion(String version)
public DependencyBuilder setScopeType(ScopeType scope)
public DependencyBuilder setScopeType(String scope)
public DependencyBuilder setPackagingType(PackagingType type)
public DependencyBuilder setPackagingType(String type)
public DependencyBuilder setClassifier(String classifier)
public DependencyBuilder setSystemPath(String systemPath)
public String getSystemPath()
DependencyDependencygetSystemPath in interface Dependencypublic String getArtifactId()
DependencyDependency.getArtifactId in interface Dependencypublic String getGroupId()
DependencyDependency.getGroupId in interface Dependencypublic String getVersion()
DependencyDependency.getVersion in interface Dependencypublic String getScopeType()
DependencyDependencygetScopeType in interface Dependencypublic boolean isSnapshot()
DependencyisSnapshot in interface Dependencypublic List<Dependency> getExcludedDependencies()
DependencyDependency objects to be excluded from this Dependency's list of inclusions when it
is included in a project.getExcludedDependencies in interface Dependencypublic ExcludedDependencyBuilder addExclusion()
public String getPackagingType()
DependencyDependencygetPackagingType in interface Dependencypublic PackagingType getPackagingTypeEnum()
DependencyPackagingType of this Dependency, if the type is not one of the default supported types,
PackagingType.OTHER will be returned;getPackagingTypeEnum in interface Dependencypublic ScopeType getScopeTypeEnum()
DependencyScopeType of this Dependency, if the type is not one of the default supported types,
ScopeType.OTHER will be returned;getScopeTypeEnum in interface Dependencypublic String getClassifier()
DependencyDependencygetClassifier in interface Dependencypublic static String toId(Dependency dep)
Dependency object into its id representation, for
example: "groupId:artifactId:::version", "groupId:artifactId:packaging::version" or
"groupId:artifactId:packaging:classifier:version"Dependency#toCoordinates()}public static String toString(Dependency dep)
Dependency object into its string representation, for
example: "groupId:artifactId:version:scope:packaging"public String toCoordinates()
DependencytoCoordinates in interface DependencyCopyright © 2013 JBoss by Red Hat. All Rights Reserved.