Forge - Dependencies API 2.0.0.Alpha3

org.jboss.forge.dependencies.builder
Class DependencyBuilder

java.lang.Object
  extended by org.jboss.forge.dependencies.builder.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

Method Summary
 DependencyBuilder addExclusion(Coordinate coordinate)
           
static DependencyBuilder create()
          Obtain a new DependencyBuilder instance.
static DependencyBuilder create(Dependency dep)
           
static DependencyBuilder create(String identifier)
           
 FileResource<?> getArtifact()
          Returns the file representing this artifact
 CoordinateBuilder getCoordinate()
          Get the Coordinate for this Dependency
 List<Coordinate> getExcludedCoordinates()
          Returns the set of Coordinate instances that are excluded from this Dependency child hierarchy.
 String getGroupId()
           
 String getScopeType()
          Get the scope type of this Dependency
 boolean isOptional()
          Returns if this dependency is optional
 DependencyBuilder setArtifact(FileResource<?> artifact)
           
 DependencyBuilder setArtifactId(String artifactId)
           
 DependencyBuilder setClassifier(String classifier)
           
 DependencyBuilder setCoordinate(Coordinate coordinate)
           
 DependencyBuilder setExcludedCoordinates(List<Coordinate> coordinates)
           
 DependencyBuilder setGroupId(String groupId)
           
 DependencyBuilder setOptional(boolean optional)
           
 DependencyBuilder setPackaging(String packaging)
           
 DependencyBuilder setScopeType(String scope)
           
 DependencyBuilder setVersion(String version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

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


create

public static DependencyBuilder create(Dependency dep)

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)

addExclusion

public DependencyBuilder addExclusion(Coordinate coordinate)

getExcludedCoordinates

public List<Coordinate> getExcludedCoordinates()
Description copied from interface: Dependency
Returns the set of Coordinate instances that are excluded from this Dependency child hierarchy.

Specified by:
getExcludedCoordinates in interface Dependency

setExcludedCoordinates

public DependencyBuilder setExcludedCoordinates(List<Coordinate> coordinates)

setPackaging

public DependencyBuilder setPackaging(String packaging)

setArtifactId

public DependencyBuilder setArtifactId(String artifactId)

setVersion

public DependencyBuilder setVersion(String version)

setGroupId

public DependencyBuilder setGroupId(String groupId)

setScopeType

public DependencyBuilder setScopeType(String scope)

getGroupId

public String getGroupId()

getScopeType

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

Specified by:
getScopeType in interface Dependency

isOptional

public boolean isOptional()
Description copied from interface: Dependency
Returns if this dependency is optional

Specified by:
isOptional in interface Dependency

setOptional

public DependencyBuilder setOptional(boolean optional)

getArtifact

public FileResource<?> getArtifact()
Description copied from interface: Dependency
Returns the file representing this artifact

Specified by:
getArtifact in interface Dependency

getCoordinate

public CoordinateBuilder getCoordinate()
Description copied from interface: Dependency
Get the Coordinate for this Dependency

Specified by:
getCoordinate in interface Dependency

setCoordinate

public DependencyBuilder setCoordinate(Coordinate coordinate)

setArtifact

public DependencyBuilder setArtifact(FileResource<?> artifact)

setClassifier

public DependencyBuilder setClassifier(String classifier)

toString

public String toString()
Overrides:
toString in class Object

Forge - Dependencies API 2.0.0.Alpha3

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.