Class ImmutableToolInfo.Builder
- java.lang.Object
-
- io.jenkins.plugins.projectenv.toolinfo.ImmutableToolInfo.Builder
-
- Enclosing class:
- ImmutableToolInfo
@NotThreadSafe public static final class ImmutableToolInfo.Builder extends Object
Builds instances of typeImmutableToolInfo
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
-
-
-
Method Detail
-
from
public final ImmutableToolInfo.Builder from(ToolInfo instance)
Fill a builder with attribute values from the providedToolInfo
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
primaryExecutable
public final ImmutableToolInfo.Builder primaryExecutable(String primaryExecutable)
Initializes the optional valueprimaryExecutable
to primaryExecutable.- Parameters:
primaryExecutable
- The value for primaryExecutable- Returns:
this
builder for chained invocation
-
primaryExecutable
public final ImmutableToolInfo.Builder primaryExecutable(Optional<String> primaryExecutable)
Initializes the optional valueprimaryExecutable
to primaryExecutable.- Parameters:
primaryExecutable
- The value for primaryExecutable- Returns:
this
builder for use in a chained invocation
-
putEnvironmentVariables
public final ImmutableToolInfo.Builder putEnvironmentVariables(String key, String value)
Put one entry to theenvironmentVariables
map.- Parameters:
key
- The key in the environmentVariables mapvalue
- The associated value in the environmentVariables map- Returns:
this
builder for use in a chained invocation
-
putEnvironmentVariables
public final ImmutableToolInfo.Builder putEnvironmentVariables(Map.Entry<String,? extends String> entry)
Put one entry to theenvironmentVariables
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
environmentVariables
public final ImmutableToolInfo.Builder environmentVariables(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for theenvironmentVariables
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the environmentVariables map- Returns:
this
builder for use in a chained invocation
-
putAllEnvironmentVariables
public final ImmutableToolInfo.Builder putAllEnvironmentVariables(Map<String,? extends String> entries)
Put all mappings from the specified map as entries toenvironmentVariables
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the environmentVariables map- Returns:
this
builder for use in a chained invocation
-
addPathElements
public final ImmutableToolInfo.Builder addPathElements(String element)
Adds one element topathElements
list.- Parameters:
element
- A pathElements element- Returns:
this
builder for use in a chained invocation
-
addPathElements
public final ImmutableToolInfo.Builder addPathElements(String... elements)
Adds elements topathElements
list.- Parameters:
elements
- An array of pathElements elements- Returns:
this
builder for use in a chained invocation
-
pathElements
public final ImmutableToolInfo.Builder pathElements(Iterable<String> elements)
Sets or replaces all elements forpathElements
list.- Parameters:
elements
- An iterable of pathElements elements- Returns:
this
builder for use in a chained invocation
-
addAllPathElements
public final ImmutableToolInfo.Builder addAllPathElements(Iterable<String> elements)
Adds elements topathElements
list.- Parameters:
elements
- An iterable of pathElements elements- Returns:
this
builder for use in a chained invocation
-
putUnhandledProjectResources
public final ImmutableToolInfo.Builder putUnhandledProjectResources(String key, String value)
Put one entry to theunhandledProjectResources
map.- Parameters:
key
- The key in the unhandledProjectResources mapvalue
- The associated value in the unhandledProjectResources map- Returns:
this
builder for use in a chained invocation
-
putUnhandledProjectResources
public final ImmutableToolInfo.Builder putUnhandledProjectResources(Map.Entry<String,? extends String> entry)
Put one entry to theunhandledProjectResources
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
unhandledProjectResources
public final ImmutableToolInfo.Builder unhandledProjectResources(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for theunhandledProjectResources
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the unhandledProjectResources map- Returns:
this
builder for use in a chained invocation
-
putAllUnhandledProjectResources
public final ImmutableToolInfo.Builder putAllUnhandledProjectResources(Map<String,? extends String> entries)
Put all mappings from the specified map as entries tounhandledProjectResources
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the unhandledProjectResources map- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableToolInfo build()
Builds a newImmutableToolInfo
.- Returns:
- An immutable instance of ToolInfo
- Throws:
IllegalStateException
- if any required attributes are missing
-
-