Package io.github.cdklabs.projen
Class Dependency.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.Dependency.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<Dependency>
- Enclosing interface:
- Dependency
@Stability(Experimental) public static final class Dependency.Builder extends Object implements software.amazon.jsii.Builder<Dependency>
A builder forDependency
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dependencybuild()Builds the configured instance.Dependency.Buildermetadata(Map<String,? extends Object> metadata)Sets the value ofDependency.getMetadata()Dependency.Buildername(String name)Sets the value ofDependencyCoordinates.getName()Dependency.Buildertype(DependencyType type)Sets the value ofDependency.getType()Dependency.Builderversion(String version)Sets the value ofDependencyCoordinates.getVersion()
-
-
-
Method Detail
-
type
@Stability(Experimental) public Dependency.Builder type(DependencyType type)
Sets the value ofDependency.getType()- Parameters:
type- Which type of dependency this is (runtime, build-time, etc). This parameter is required.- Returns:
this
-
metadata
@Stability(Experimental) public Dependency.Builder metadata(Map<String,? extends Object> metadata)
Sets the value ofDependency.getMetadata()- Parameters:
metadata- Additional JSON metadata associated with the dependency (package manager specific).- Returns:
this
-
name
@Stability(Experimental) public Dependency.Builder name(String name)
Sets the value ofDependencyCoordinates.getName()- Parameters:
name- The package manager name of the dependency (e.g.leftpadfor npm). This parameter is required. NOTE: For package managers that use complex coordinates (like Maven), we will codify it into a string somehow.- Returns:
this
-
version
@Stability(Experimental) public Dependency.Builder version(String version)
Sets the value ofDependencyCoordinates.getVersion()- Parameters:
version- Semantic version version requirement.- Returns:
this
-
build
@Stability(Experimental) public Dependency build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<Dependency>- Returns:
- a new instance of
Dependency - Throws:
NullPointerException- if any required attribute was not provided
-
-