Package io.dialob.api.rest
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 ofItems.Use the builder to create immutable instances:
ImmutableItems.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableItems.BuilderBuilds instances of typeImmutableItems.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableItems.Builderbuilder()Creates a builder forImmutableItems.static ImmutableItemscopyOf(Items instance)Creates an immutable copy of aItemsvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableItemsthat have equal attribute values.StringgetActiveItem()List<String>getAvailableItems()List<String>getItems()inthashCode()Computes a hash code from attributes:activeItem,items,availableItems.StringtoString()Prints the immutable valueItemswith attribute values.ImmutableItemswithActiveItem(String value)Copy the current immutable object by setting a value for theactiveItemattribute.ImmutableItemswithAvailableItems(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofavailableItems.ImmutableItemswithAvailableItems(String... elements)Copy the current immutable object with elements that replace the content ofavailableItems.ImmutableItemswithItems(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofitems.ImmutableItemswithItems(String... elements)Copy the current immutable object with elements that replace the content ofitems.
-
-
-
Method Detail
-
getActiveItem
public String getActiveItem()
- Specified by:
getActiveItemin interfaceItems- Returns:
- The value of the
activeItemattribute
-
getAvailableItems
public List<String> getAvailableItems()
- Specified by:
getAvailableItemsin interfaceItems- Returns:
- The value of the
availableItemsattribute
-
withActiveItem
public final ImmutableItems withActiveItem(String value)
Copy the current immutable object by setting a value for theactiveItemattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for activeItem- Returns:
- A modified copy of the
thisobject
-
withItems
public final ImmutableItems withItems(String... elements)
Copy the current immutable object with elements that replace the content ofitems.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withItems
public final ImmutableItems withItems(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofitems. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of items elements to set- Returns:
- A modified copy of
thisobject
-
withAvailableItems
public final ImmutableItems withAvailableItems(String... elements)
Copy the current immutable object with elements that replace the content ofavailableItems.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAvailableItems
public final ImmutableItems withAvailableItems(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofavailableItems. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of availableItems elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableItemsthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:activeItem,items,availableItems.
-
toString
public String toString()
Prints the immutable valueItemswith attribute values.
-
copyOf
public static ImmutableItems copyOf(Items instance)
Creates an immutable copy of aItemsvalue. 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 forImmutableItems.ImmutableItems.builder() .activeItem(String) // requiredactiveItem.addItems|addAllItems(String) //itemselements .addAvailableItems|addAllAvailableItems(String) //availableItemselements .build();- Returns:
- A new ImmutableItems builder
-
-