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 of
Items.
Use the builder to create immutable instances:
ImmutableItems.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableItems.Builderbuilder()Creates a builder forImmutableItems.static ImmutableItemsCreates an immutable copy of aItemsvalue.booleanThis instance is equal to all instances ofImmutableItemsthat have equal attribute values.getItems()inthashCode()Computes a hash code from attributes:activeItem,items,availableItems.toString()Prints the immutable valueItemswith attribute values.final ImmutableItemswithActiveItem(String value) Copy the current immutable object by setting a value for theactiveItemattribute.final ImmutableItemswithAvailableItems(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofavailableItems.final ImmutableItemswithAvailableItems(String... elements) Copy the current immutable object with elements that replace the content ofavailableItems.final ImmutableItemsCopy the current immutable object with elements that replace the content ofitems.final ImmutableItemsCopy the current immutable object with elements that replace the content ofitems.
-
Method Details
-
getActiveItem
- Specified by:
getActiveItemin interfaceItems- Returns:
- The value of the
activeItemattribute
-
getItems
-
getAvailableItems
- Specified by:
getAvailableItemsin interfaceItems- Returns:
- The value of the
availableItemsattribute
-
withActiveItem
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
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
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
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
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
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
Prints the immutable valueItemswith attribute values. -
copyOf
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
Creates a builder forImmutableItems.ImmutableItems.builder() .activeItem(String) // requiredactiveItem.addItems|addAllItems(String) //itemselements .addAvailableItems|addAllAvailableItems(String) //availableItemselements .build();- Returns:
- A new ImmutableItems builder
-