Package io.dialob.program.model
Class ImmutableProgram
- java.lang.Object
-
- io.dialob.program.model.ImmutableProgram
-
- All Implemented Interfaces:
Program,ProgramNode,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableProgram extends Object implements Program
Immutable implementation ofProgram.Use the builder to create immutable instances:
ImmutableProgram.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableProgram.BuilderBuilds instances of typeImmutableProgram.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableProgram.Builderbuilder()Creates a builder forImmutableProgram.static ImmutableProgramcopyOf(Program instance)Creates an immutable copy of aProgramvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableProgramthat have equal attribute values.StringgetId()com.google.common.collect.ImmutableList<Item>getItems()ItemgetRootItem()com.google.common.collect.ImmutableList<ValueSet>getValueSets()inthashCode()Computes a hash code from attributes:id,rootItem,items,valueSets.StringtoString()Prints the immutable valueProgramwith attribute values.ImmutableProgramwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableProgramwithItems(Item... elements)Copy the current immutable object with elements that replace the content ofitems.ImmutableProgramwithItems(Iterable<? extends Item> elements)Copy the current immutable object with elements that replace the content ofitems.ImmutableProgramwithRootItem(Item value)Copy the current immutable object by setting a value for therootItemattribute.ImmutableProgramwithValueSets(ValueSet... elements)Copy the current immutable object with elements that replace the content ofvalueSets.ImmutableProgramwithValueSets(Iterable<? extends ValueSet> elements)Copy the current immutable object with elements that replace the content ofvalueSets.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.dialob.program.model.Program
accept, findItemsBy, getItem
-
-
-
-
Method Detail
-
getId
public String getId()
-
getRootItem
public Item getRootItem()
- Specified by:
getRootItemin interfaceProgram- Returns:
- The value of the
rootItemattribute
-
getItems
public com.google.common.collect.ImmutableList<Item> getItems()
-
getValueSets
public com.google.common.collect.ImmutableList<ValueSet> getValueSets()
- Specified by:
getValueSetsin interfaceProgram- Returns:
- The value of the
valueSetsattribute
-
withId
public final ImmutableProgram withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withRootItem
public final ImmutableProgram withRootItem(Item value)
Copy the current immutable object by setting a value for therootItemattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rootItem- Returns:
- A modified copy of the
thisobject
-
withItems
public final ImmutableProgram withItems(Item... 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 ImmutableProgram withItems(Iterable<? extends Item> 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
-
withValueSets
public final ImmutableProgram withValueSets(ValueSet... elements)
Copy the current immutable object with elements that replace the content ofvalueSets.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withValueSets
public final ImmutableProgram withValueSets(Iterable<? extends ValueSet> elements)
Copy the current immutable object with elements that replace the content ofvalueSets. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of valueSets elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableProgramthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,rootItem,items,valueSets.
-
toString
public String toString()
Prints the immutable valueProgramwith attribute values.
-
copyOf
public static ImmutableProgram copyOf(Program instance)
Creates an immutable copy of aProgramvalue. 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 Program instance
-
builder
public static ImmutableProgram.Builder builder()
Creates a builder forImmutableProgram.ImmutableProgram.builder() .id(String) // requiredid.rootItem(io.dialob.program.model.Item) // requiredrootItem.addItems|addAllItems(io.dialob.program.model.Item) //itemselements .addValueSets|addAllValueSets(io.dialob.program.model.ValueSet) //valueSetselements .build();- Returns:
- A new ImmutableProgram builder
-
-