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().

  • Method Details

    • getPrimaryExecutable

      public Optional<String> getPrimaryExecutable()
      Specified by:
      getPrimaryExecutable in interface ToolInfo
      Returns:
      The value of the primaryExecutable attribute
    • getEnvironmentVariables

      public Map<String,String> getEnvironmentVariables()
      Specified by:
      getEnvironmentVariables in interface ToolInfo
      Returns:
      The value of the environmentVariables attribute
    • getPathElements

      public List<String> getPathElements()
      Specified by:
      getPathElements in interface ToolInfo
      Returns:
      The value of the pathElements attribute
    • getUnhandledProjectResources

      public Map<String,String> getUnhandledProjectResources()
      Specified by:
      getUnhandledProjectResources in interface ToolInfo
      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 optional primaryExecutable 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 the primaryExecutable attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      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 the environmentVariables 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 returning this.
      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 of pathElements.
      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 of pathElements. A shallow reference equality check is used to prevent copying of the same value by returning this.
      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 the unhandledProjectResources 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 returning this.
      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 of ImmutableToolInfo that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: primaryExecutable, environmentVariables, pathElements, unhandledProjectResources.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ToolInfo with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableToolInfo copyOf(ToolInfo instance)
      Creates an immutable copy of a ToolInfo 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 for ImmutableToolInfo.
       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