Class ImmutableItemStates.Builder

  • Enclosing class:
    ImmutableItemStates

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

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder from​(ItemStates instance)
        Fill a builder with attribute values from the provided ItemStates 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
      • putItemStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putItemStates​(ItemId key,
                                                               ItemState value)
        Put one entry to the itemStates map.
        Parameters:
        key - The key in the itemStates map
        value - The associated value in the itemStates map
        Returns:
        this builder for use in a chained invocation
      • putItemStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putItemStates​(Map.Entry<? extends ItemId,​? extends ItemState> entry)
        Put one entry to the itemStates map. Nulls are not permitted
        Parameters:
        entry - The key and value entry
        Returns:
        this builder for use in a chained invocation
      • itemStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder itemStates​(Map<? extends ItemId,​? extends ItemState> entries)
        Sets or replaces all mappings from the specified map as entries for the itemStates map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the itemStates map
        Returns:
        this builder for use in a chained invocation
      • putAllItemStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putAllItemStates​(Map<? extends ItemId,​? extends ItemState> entries)
        Put all mappings from the specified map as entries to itemStates map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the itemStates map
        Returns:
        this builder for use in a chained invocation
      • putValueSetStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putValueSetStates​(ValueSetId key,
                                                                   ValueSetState value)
        Put one entry to the valueSetStates map.
        Parameters:
        key - The key in the valueSetStates map
        value - The associated value in the valueSetStates map
        Returns:
        this builder for use in a chained invocation
      • valueSetStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder valueSetStates​(Map<? extends ValueSetId,​? extends ValueSetState> entries)
        Sets or replaces all mappings from the specified map as entries for the valueSetStates map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the valueSetStates map
        Returns:
        this builder for use in a chained invocation
      • putAllValueSetStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putAllValueSetStates​(Map<? extends ValueSetId,​? extends ValueSetState> entries)
        Put all mappings from the specified map as entries to valueSetStates map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the valueSetStates map
        Returns:
        this builder for use in a chained invocation
      • putErrorStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putErrorStates​(ErrorId key,
                                                                ErrorState value)
        Put one entry to the errorStates map.
        Parameters:
        key - The key in the errorStates map
        value - The associated value in the errorStates map
        Returns:
        this builder for use in a chained invocation
      • putErrorStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putErrorStates​(Map.Entry<? extends ErrorId,​? extends ErrorState> entry)
        Put one entry to the errorStates map. Nulls are not permitted
        Parameters:
        entry - The key and value entry
        Returns:
        this builder for use in a chained invocation
      • errorStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder errorStates​(Map<? extends ErrorId,​? extends ErrorState> entries)
        Sets or replaces all mappings from the specified map as entries for the errorStates map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the errorStates map
        Returns:
        this builder for use in a chained invocation
      • putAllErrorStates

        @CanIgnoreReturnValue
        public final ImmutableItemStates.Builder putAllErrorStates​(Map<? extends ErrorId,​? extends ErrorState> entries)
        Put all mappings from the specified map as entries to errorStates map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the errorStates map
        Returns:
        this builder for use in a chained invocation