Class ImmutableProgram
java.lang.Object
io.dialob.session.engine.program.model.ImmutableProgram
- All Implemented Interfaces:
Program,ProgramNode,Serializable
@Generated(from="Program",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableProgram
extends Object
implements Program
Immutable implementation of
Program.
Use the builder to create immutable instances:
ImmutableProgram.builder().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableProgram.Builderbuilder()Creates a builder forImmutableProgram.static ImmutableProgramCreates an immutable copy of aProgramvalue.booleanThis instance is equal to all instances ofImmutableProgramthat have equal attribute values.getId()com.google.common.collect.ImmutableList<Item> getItems()com.google.common.collect.ImmutableList<ValueSet> inthashCode()Computes a hash code from attributes:id,rootItem,items,valueSets.toString()Prints the immutable valueProgramwith attribute values.final ImmutableProgramCopy the current immutable object by setting a value for theidattribute.final ImmutableProgramCopy the current immutable object with elements that replace the content ofitems.final ImmutableProgramCopy the current immutable object with elements that replace the content ofitems.final ImmutableProgramwithRootItem(Item value) Copy the current immutable object by setting a value for therootItemattribute.final ImmutableProgramwithValueSets(ValueSet... elements) Copy the current immutable object with elements that replace the content ofvalueSets.final 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, waitMethods inherited from interface io.dialob.session.engine.program.model.Program
accept, findItemsBy, getItem
-
Method Details
-
getId
-
getRootItem
- Specified by:
getRootItemin interfaceProgram- Returns:
- The value of the
rootItemattribute
-
getItems
-
getValueSets
- Specified by:
getValueSetsin interfaceProgram- Returns:
- The value of the
valueSetsattribute
-
withId
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 or the
thisobject
-
withRootItem
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 or 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 or
thisif not changed
-
withValueSets
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
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 or
thisif not changed
-
equals
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
Prints the immutable valueProgramwith attribute values. -
copyOf
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
Creates a builder forImmutableProgram.ImmutableProgram.builder() .id(String) // requiredid.rootItem(io.dialob.session.engine.program.model.Item) // requiredrootItem.addItems|addAllItems(io.dialob.session.engine.program.model.Item) //itemselements .addValueSets|addAllValueSets(io.dialob.session.engine.program.model.ValueSet) //valueSetselements .build();- Returns:
- A new ImmutableProgram builder
-