Forge - Parent 1.0.0.Final

org.jboss.forge.project.dependencies
Class DependencyBuilder

java.lang.Object
  extended by org.jboss.forge.project.dependencies.DependencyBuilder
All Implemented Interfaces:
Dependency

public class DependencyBuilder
extends Object
implements Dependency

Builder to create Dependency objects. This class implements Dependency for easy consumption. (I.e.: Use this class wherever you need to create and use a new Dependency)

Author:
Lincoln Baxter, III

Constructor Summary
protected DependencyBuilder()
           
 
Method Summary
 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 getVersion()
          Get the version of this Dependency.
 int hashCode()
           
 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 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"
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DependencyBuilder

protected DependencyBuilder()
Method Detail

create

public static DependencyBuilder create()
Obtain a new DependencyBuilder instance.


create

public static DependencyBuilder create(Dependency dep)

areEquivalent

public static boolean areEquivalent(Dependency l,
                                    Dependency r)
Return true if the groupId and artifactId of the two given dependencies are equal.


create

public static DependencyBuilder create(String identifier)
Parameters:
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)

setGroupId

public DependencyBuilder setGroupId(String groupId)

setArtifactId

public DependencyBuilder setArtifactId(String artifactId)

setVersion

public DependencyBuilder setVersion(String version)

setScopeType

public DependencyBuilder setScopeType(ScopeType scope)

setScopeType

public DependencyBuilder setScopeType(String scope)

setPackagingType

public DependencyBuilder setPackagingType(PackagingType type)

setPackagingType

public DependencyBuilder setPackagingType(String type)

setClassifier

public DependencyBuilder setClassifier(String classifier)

getArtifactId

public String getArtifactId()
Description copied from interface: Dependency
Get the minor-identifier for this Dependency.

Specified by:
getArtifactId in interface Dependency

getGroupId

public String getGroupId()
Description copied from interface: Dependency
Get the major identifier for this Dependency.

Specified by:
getGroupId in interface Dependency

getVersion

public String getVersion()
Description copied from interface: Dependency
Get the version of this Dependency.

Specified by:
getVersion in interface Dependency

getScopeType

public String getScopeType()
Description copied from interface: Dependency
Get the scope type of this Dependency

Specified by:
getScopeType in interface Dependency

getExcludedDependencies

public List<Dependency> getExcludedDependencies()
Description copied from interface: Dependency
Get a list of Dependency objects to be excluded from this Dependency's list of inclusions when it is included in a project.

Specified by:
getExcludedDependencies in interface Dependency

addExclusion

public ExcludedDependencyBuilder addExclusion()

getPackagingType

public String getPackagingType()
Description copied from interface: Dependency
Get the specified packaging type of this Dependency

Specified by:
getPackagingType in interface Dependency

getPackagingTypeEnum

public PackagingType getPackagingTypeEnum()
Description copied from interface: Dependency
Get the PackagingType of this Dependency, if the type is not one of the default supported types, PackagingType.OTHER will be returned;

Specified by:
getPackagingTypeEnum in interface Dependency

getScopeTypeEnum

public ScopeType getScopeTypeEnum()
Description copied from interface: Dependency
Get the ScopeType of this Dependency, if the type is not one of the default supported types, ScopeType.OTHER will be returned;

Specified by:
getScopeTypeEnum in interface Dependency

getClassifier

public String getClassifier()
Description copied from interface: Dependency
Get the classifier for this Dependency

Specified by:
getClassifier in interface Dependency

toId

public 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"

See Also:
Dependency#toCoordinates()}

toString

public 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"


toCoordinates

public String toCoordinates()
Description copied from interface: Dependency
Return a string represenging this dependency in the form of a standard identifier. E.g: "groupId : artifactId : version"

Specified by:
toCoordinates in interface Dependency

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Forge - Parent 1.0.0.Final

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.