Class ImmutableOutput.Builder

  • Enclosing class:
    ImmutableOutput

    @NotThreadSafe
    public static final class ImmutableOutput.Builder
    extends Object
    Builds instances of type ImmutableOutput. 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.

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for ImmutableOutput instances.
    • Method Detail

      • from

        public final ImmutableOutput.Builder from​(Output instance)
        Fill a builder with attribute values from the provided Output 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
      • id

        public final ImmutableOutput.Builder id​(@Nullable
                                                String id)
        Initializes the value for the id attribute.
        Parameters:
        id - The value for id (can be null)
        Returns:
        this builder for use in a chained invocation
      • collectionID

        public final ImmutableOutput.Builder collectionID​(@Nullable
                                                          String collectionID)
        Initializes the value for the collectionID attribute.
        Parameters:
        collectionID - The value for collectionID (can be null)
        Returns:
        this builder for use in a chained invocation
      • type

        public final ImmutableOutput.Builder type​(@Nullable
                                                  String type)
        Initializes the value for the type attribute.
        Parameters:
        type - The value for type (can be null)
        Returns:
        this builder for use in a chained invocation
      • putConfig

        public final ImmutableOutput.Builder putConfig​(String key,
                                                       Object value)
        Put one entry to the config map.
        Parameters:
        key - The key in the config map
        value - The associated value in the config map
        Returns:
        this builder for use in a chained invocation
      • putConfig

        public final ImmutableOutput.Builder putConfig​(Map.Entry<String,​? extends Object> entry)
        Put one entry to the config map. Nulls are not permitted
        Parameters:
        entry - The key and value entry
        Returns:
        this builder for use in a chained invocation
      • config

        public final ImmutableOutput.Builder config​(@Nullable
                                                    Map<String,​? extends Object> config)
        Sets or replaces all mappings from the specified map as entries for the config map. Nulls are not permitted as keys or values, but parameter itself can be null
        Parameters:
        config - The entries that will be added to the config map
        Returns:
        this builder for use in a chained invocation
      • putAllConfig

        public final ImmutableOutput.Builder putAllConfig​(Map<String,​? extends Object> config)
        Put all mappings from the specified map as entries to config map. Nulls are not permitted
        Parameters:
        config - The entries that will be added to the config map
        Returns:
        this builder for use in a chained invocation