Class ImmutableToolInfo.Builder

  • Enclosing class:
    ImmutableToolInfo

    @NotThreadSafe
    public static final class ImmutableToolInfo.Builder
    extends Object
    Builds instances of type ImmutableToolInfo. Initialize attributes and then invoke the build() 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 Detail

      • from

        public final ImmutableToolInfo.Builder from​(ToolInfo instance)
        Fill a builder with attribute values from the provided ToolInfo 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 value primaryExecutable 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 value primaryExecutable 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 the environmentVariables map.
        Parameters:
        key - The key in the environmentVariables map
        value - The associated value in the environmentVariables map
        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 the environmentVariables 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 to environmentVariables 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 to pathElements 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 to pathElements 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 for pathElements 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 to pathElements 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 the unhandledProjectResources map.
        Parameters:
        key - The key in the unhandledProjectResources map
        value - The associated value in the unhandledProjectResources map
        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 the unhandledProjectResources 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 to unhandledProjectResources 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