Class ImmutableItems

java.lang.Object
io.dialob.api.rest.ImmutableItems
All Implemented Interfaces:
Items

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

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

  • Method Details

    • getActiveItem

      public String getActiveItem()
      Specified by:
      getActiveItem in interface Items
      Returns:
      The value of the activeItem attribute
    • getItems

      public List<String> getItems()
      Specified by:
      getItems in interface Items
      Returns:
      The value of the items attribute
    • getAvailableItems

      public List<String> getAvailableItems()
      Specified by:
      getAvailableItems in interface Items
      Returns:
      The value of the availableItems attribute
    • withActiveItem

      public final ImmutableItems withActiveItem(String value)
      Copy the current immutable object by setting a value for the activeItem attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for activeItem
      Returns:
      A modified copy of the this object
    • withItems

      public final ImmutableItems withItems(String... elements)
      Copy the current immutable object with elements that replace the content of items.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withItems

      public final ImmutableItems withItems(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of items. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of items elements to set
      Returns:
      A modified copy of this object
    • withAvailableItems

      public final ImmutableItems withAvailableItems(String... elements)
      Copy the current immutable object with elements that replace the content of availableItems.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAvailableItems

      public final ImmutableItems withAvailableItems(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of availableItems. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of availableItems elements to set
      Returns:
      A modified copy of this object
    • equals

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

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

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

      public static ImmutableItems.Builder builder()
      Creates a builder for ImmutableItems.
       ImmutableItems.builder()
          .activeItem(String) // required activeItem
          .addItems|addAllItems(String) // items elements
          .addAvailableItems|addAllAvailableItems(String) // availableItems elements
          .build();
       
      Returns:
      A new ImmutableItems builder