Package io.resys.hdes.client.api.ast
Class ImmutableAstSource
java.lang.Object
io.resys.hdes.client.api.ast.ImmutableAstSource
- All Implemented Interfaces:
AstBody.AstSource,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableAstSource
extends Object
implements AstBody.AstSource
Immutable implementation of
AstBody.AstSource.
Use the builder to create immutable instances:
ImmutableAstSource.builder().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableAstSource.Builderbuilder()Creates a builder forImmutableAstSource.static ImmutableAstSourcecopyOf(AstBody.AstSource instance) Creates an immutable copy of aAstBody.AstSourcevalue.booleanThis instance is equal to all instances ofImmutableAstSourcethat have equal attribute values.com.google.common.collect.ImmutableList<AstCommand>getHash()getId()inthashCode()Computes a hash code from attributes:id,hash,bodyType,commands.toString()Prints the immutable valueAstSourcewith attribute values.final ImmutableAstSourcewithBodyType(AstBody.AstBodyType value) Copy the current immutable object by setting a value for thebodyTypeattribute.final ImmutableAstSourcewithCommands(AstCommand... elements) Copy the current immutable object with elements that replace the content ofcommands.final ImmutableAstSourcewithCommands(Iterable<? extends AstCommand> elements) Copy the current immutable object with elements that replace the content ofcommands.final ImmutableAstSourceCopy the current immutable object by setting a value for thehashattribute.final ImmutableAstSourceCopy the current immutable object by setting a value for theidattribute.
-
Method Details
-
getId
- Specified by:
getIdin interfaceAstBody.AstSource- Returns:
- The value of the
idattribute
-
getHash
- Specified by:
getHashin interfaceAstBody.AstSource- Returns:
- The value of the
hashattribute
-
getBodyType
- Specified by:
getBodyTypein interfaceAstBody.AstSource- Returns:
- The value of the
bodyTypeattribute
-
getCommands
- Specified by:
getCommandsin interfaceAstBody.AstSource- Returns:
- The value of the
commandsattribute
-
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 of the
thisobject
-
withHash
Copy the current immutable object by setting a value for thehashattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hash- Returns:
- A modified copy of the
thisobject
-
withBodyType
Copy the current immutable object by setting a value for thebodyTypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bodyType- Returns:
- A modified copy of the
thisobject
-
withCommands
Copy the current immutable object with elements that replace the content ofcommands.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withCommands
Copy the current immutable object with elements that replace the content ofcommands. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of commands elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableAstSourcethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,hash,bodyType,commands. -
toString
Prints the immutable valueAstSourcewith attribute values. -
copyOf
Creates an immutable copy of aAstBody.AstSourcevalue. 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 AstSource instance
-
builder
Creates a builder forImmutableAstSource.ImmutableAstSource.builder() .id(String) // requiredid.hash(String) // requiredhash.bodyType(io.resys.hdes.client.api.ast.AstBody.AstBodyType) // requiredbodyType.addCommands|addAllCommands(io.resys.hdes.client.api.ast.AstCommand) //commandselements .build();- Returns:
- A new ImmutableAstSource builder
-