Class ImmutableLifecycle.Builder

  • Enclosing class:
    ImmutableLifecycle

    public static final class ImmutableLifecycle.Builder
    extends Object
    Builds instances of type ImmutableLifecycle. 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 ImmutableLifecycle.Builder from​(Lifecycle instance)
        Fill a builder with attribute values from the provided Lifecycle 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
      • type

        public final ImmutableLifecycle.Builder type​(LifecycleType type)
        Initializes the value for the type attribute.
        Parameters:
        type - The value for type
        Returns:
        this builder for use in a chained invocation
      • putData

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

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

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

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