Class ImmutableItemStates

  • All Implemented Interfaces:
    ItemStates

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableItemStates
    extends Object
    implements ItemStates
    Immutable implementation of ItemStates.

    Use the builder to create immutable instances: ImmutableItemStates.builder().

    • Method Detail

      • getItemStates

        public com.google.common.collect.ImmutableMap<ItemId,​ItemState> getItemStates()
        Specified by:
        getItemStates in interface ItemStates
        Returns:
        The value of the itemStates attribute
      • getErrorStates

        public com.google.common.collect.ImmutableMap<ErrorId,​ErrorState> getErrorStates()
        Specified by:
        getErrorStates in interface ItemStates
        Returns:
        The value of the errorStates attribute
      • withItemStates

        public final ImmutableItemStates withItemStates​(Map<? extends ItemId,​? extends ItemState> entries)
        Copy the current immutable object by replacing the itemStates 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 itemStates map
        Returns:
        A modified copy of this object
      • withValueSetStates

        public final ImmutableItemStates withValueSetStates​(Map<? extends ValueSetId,​? extends ValueSetState> entries)
        Copy the current immutable object by replacing the valueSetStates 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 valueSetStates map
        Returns:
        A modified copy of this object
      • withErrorStates

        public final ImmutableItemStates withErrorStates​(Map<? extends ErrorId,​? extends ErrorState> entries)
        Copy the current immutable object by replacing the errorStates 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 errorStates map
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableItemStates 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: itemStates, valueSetStates, errorStates.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableItemStates copyOf​(ItemStates instance)
        Creates an immutable copy of a ItemStates 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 ItemStates instance
      • builder

        public static ImmutableItemStates.Builder builder()
        Creates a builder for ImmutableItemStates.
         ImmutableItemStates.builder()
            .putItemStates|putAllItemStates(io.dialob.executor.model.ItemId => io.dialob.executor.model.ItemState) // itemStates mappings
            .putValueSetStates|putAllValueSetStates(io.dialob.executor.model.ValueSetId => io.dialob.executor.model.ValueSetState) // valueSetStates mappings
            .putErrorStates|putAllErrorStates(io.dialob.executor.model.ErrorId => io.dialob.executor.model.ErrorState) // errorStates mappings
            .build();
         
        Returns:
        A new ImmutableItemStates builder