Class ImmutableToolInfo
- java.lang.Object
-
- io.jenkins.plugins.projectenv.toolinfo.ImmutableToolInfo
-
- All Implemented Interfaces:
ToolInfo
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableToolInfo extends Object implements ToolInfo
Immutable implementation ofToolInfo
.Use the builder to create immutable instances:
ImmutableToolInfo.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableToolInfo.Builder
Builds instances of typeImmutableToolInfo
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableToolInfo.Builder
builder()
Creates a builder forImmutableToolInfo
.static ImmutableToolInfo
copyOf(ToolInfo instance)
Creates an immutable copy of aToolInfo
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableToolInfo
that have equal attribute values.Map<String,String>
getEnvironmentVariables()
List<String>
getPathElements()
Optional<String>
getPrimaryExecutable()
Map<String,String>
getUnhandledProjectResources()
int
hashCode()
Computes a hash code from attributes:primaryExecutable
,environmentVariables
,pathElements
,unhandledProjectResources
.String
toString()
Prints the immutable valueToolInfo
with attribute values.ImmutableToolInfo
withEnvironmentVariables(Map<String,? extends String> entries)
Copy the current immutable object by replacing theenvironmentVariables
map with the specified map.ImmutableToolInfo
withPathElements(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofpathElements
.ImmutableToolInfo
withPathElements(String... elements)
Copy the current immutable object with elements that replace the content ofpathElements
.ImmutableToolInfo
withPrimaryExecutable(String value)
Copy the current immutable object by setting a present value for the optionalprimaryExecutable
attribute.ImmutableToolInfo
withPrimaryExecutable(Optional<String> optional)
Copy the current immutable object by setting an optional value for theprimaryExecutable
attribute.ImmutableToolInfo
withUnhandledProjectResources(Map<String,? extends String> entries)
Copy the current immutable object by replacing theunhandledProjectResources
map with the specified map.
-
-
-
Method Detail
-
getPrimaryExecutable
public Optional<String> getPrimaryExecutable()
- Specified by:
getPrimaryExecutable
in interfaceToolInfo
- Returns:
- The value of the
primaryExecutable
attribute
-
getEnvironmentVariables
public Map<String,String> getEnvironmentVariables()
- Specified by:
getEnvironmentVariables
in interfaceToolInfo
- Returns:
- The value of the
environmentVariables
attribute
-
getPathElements
public List<String> getPathElements()
- Specified by:
getPathElements
in interfaceToolInfo
- Returns:
- The value of the
pathElements
attribute
-
getUnhandledProjectResources
public Map<String,String> getUnhandledProjectResources()
- Specified by:
getUnhandledProjectResources
in interfaceToolInfo
- Returns:
- The value of the
unhandledProjectResources
attribute
-
withPrimaryExecutable
public final ImmutableToolInfo withPrimaryExecutable(String value)
Copy the current immutable object by setting a present value for the optionalprimaryExecutable
attribute.- Parameters:
value
- The value for primaryExecutable- Returns:
- A modified copy of
this
object
-
withPrimaryExecutable
public final ImmutableToolInfo withPrimaryExecutable(Optional<String> optional)
Copy the current immutable object by setting an optional value for theprimaryExecutable
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for primaryExecutable- Returns:
- A modified copy of
this
object
-
withEnvironmentVariables
public final ImmutableToolInfo withEnvironmentVariables(Map<String,? extends String> entries)
Copy the current immutable object by replacing theenvironmentVariables
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the environmentVariables map- Returns:
- A modified copy of
this
object
-
withPathElements
public final ImmutableToolInfo withPathElements(String... elements)
Copy the current immutable object with elements that replace the content ofpathElements
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withPathElements
public final ImmutableToolInfo withPathElements(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofpathElements
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of pathElements elements to set- Returns:
- A modified copy of
this
object
-
withUnhandledProjectResources
public final ImmutableToolInfo withUnhandledProjectResources(Map<String,? extends String> entries)
Copy the current immutable object by replacing theunhandledProjectResources
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the unhandledProjectResources map- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableToolInfo
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:primaryExecutable
,environmentVariables
,pathElements
,unhandledProjectResources
.
-
toString
public String toString()
Prints the immutable valueToolInfo
with attribute values.
-
copyOf
public static ImmutableToolInfo copyOf(ToolInfo instance)
Creates an immutable copy of aToolInfo
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable ToolInfo instance
-
builder
public static ImmutableToolInfo.Builder builder()
Creates a builder forImmutableToolInfo
.ImmutableToolInfo.builder() .primaryExecutable(String) // optional
primaryExecutable
.putEnvironmentVariables|putAllEnvironmentVariables(String => String) //environmentVariables
mappings .addPathElements|addAllPathElements(String) //pathElements
elements .putUnhandledProjectResources|putAllUnhandledProjectResources(String => String) //unhandledProjectResources
mappings .build();- Returns:
- A new ImmutableToolInfo builder
-
-