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 of
ToolInfo.
Use the builder to create immutable instances:
ImmutableToolInfo.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableToolInfo.Builderbuilder()Creates a builder forImmutableToolInfo.static ImmutableToolInfoCreates an immutable copy of aToolInfovalue.booleanThis instance is equal to all instances ofImmutableToolInfothat have equal attribute values.inthashCode()Computes a hash code from attributes:primaryExecutable,environmentVariables,pathElements,unhandledProjectResources.toString()Prints the immutable valueToolInfowith attribute values.final ImmutableToolInfowithEnvironmentVariables(Map<String, ? extends String> entries) Copy the current immutable object by replacing theenvironmentVariablesmap with the specified map.final ImmutableToolInfowithPathElements(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofpathElements.final ImmutableToolInfowithPathElements(String... elements) Copy the current immutable object with elements that replace the content ofpathElements.final ImmutableToolInfowithPrimaryExecutable(String value) Copy the current immutable object by setting a present value for the optionalprimaryExecutableattribute.final ImmutableToolInfowithPrimaryExecutable(Optional<String> optional) Copy the current immutable object by setting an optional value for theprimaryExecutableattribute.final ImmutableToolInfowithUnhandledProjectResources(Map<String, ? extends String> entries) Copy the current immutable object by replacing theunhandledProjectResourcesmap with the specified map.
-
Method Details
-
getPrimaryExecutable
- Specified by:
getPrimaryExecutablein interfaceToolInfo- Returns:
- The value of the
primaryExecutableattribute
-
getEnvironmentVariables
- Specified by:
getEnvironmentVariablesin interfaceToolInfo- Returns:
- The value of the
environmentVariablesattribute
-
getPathElements
- Specified by:
getPathElementsin interfaceToolInfo- Returns:
- The value of the
pathElementsattribute
-
getUnhandledProjectResources
- Specified by:
getUnhandledProjectResourcesin interfaceToolInfo- Returns:
- The value of the
unhandledProjectResourcesattribute
-
withPrimaryExecutable
Copy the current immutable object by setting a present value for the optionalprimaryExecutableattribute.- Parameters:
value- The value for primaryExecutable- Returns:
- A modified copy of
thisobject
-
withPrimaryExecutable
Copy the current immutable object by setting an optional value for theprimaryExecutableattribute. 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
thisobject
-
withEnvironmentVariables
Copy the current immutable object by replacing theenvironmentVariablesmap 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
thisobject
-
withPathElements
Copy the current immutable object with elements that replace the content ofpathElements.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPathElements
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
thisobject
-
withUnhandledProjectResources
Copy the current immutable object by replacing theunhandledProjectResourcesmap 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
thisobject
-
equals
This instance is equal to all instances ofImmutableToolInfothat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:primaryExecutable,environmentVariables,pathElements,unhandledProjectResources. -
toString
Prints the immutable valueToolInfowith attribute values. -
copyOf
Creates an immutable copy of aToolInfovalue. 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
Creates a builder forImmutableToolInfo.ImmutableToolInfo.builder() .primaryExecutable(String) // optionalprimaryExecutable.putEnvironmentVariables|putAllEnvironmentVariables(String => String) //environmentVariablesmappings .addPathElements|addAllPathElements(String) //pathElementselements .putUnhandledProjectResources|putAllUnhandledProjectResources(String => String) //unhandledProjectResourcesmappings .build();- Returns:
- A new ImmutableToolInfo builder
-