Class ImmutableTrees.InvokableDeclaration
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.InvokableDeclaration
-
- All Implemented Interfaces:
Trees.InvokableDeclaration,Trees.Named
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.InvokableDeclaration extends java.lang.Object implements Trees.InvokableDeclaration
Immutable implementation ofTrees.InvokableDeclaration.Use the builder to create immutable instances:
ImmutableTrees.InvokableDeclaration.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.InvokableDeclaration.BuilderBuilds instances of typeInvokableDeclaration.
-
Field Summary
Fields Modifier and Type Field Description private Trees.Identifiernameprivate com.google.common.collect.ImmutableList<Trees.Parameter>parameters
-
Constructor Summary
Constructors Modifier Constructor Description privateInvokableDeclaration(Trees.Identifier name, com.google.common.collect.ImmutableList<Trees.Parameter> parameters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.InvokableDeclaration.Builderbuilder()Creates a builder forInvokableDeclaration.static ImmutableTrees.InvokableDeclarationcopyOf(Trees.InvokableDeclaration instance)Creates an immutable copy of aTrees.InvokableDeclarationvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofInvokableDeclarationthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.InvokableDeclaration another)inthashCode()Computes a hash code from attributes:name,parameters.Trees.Identifiername()com.google.common.collect.ImmutableList<Trees.Parameter>parameters()java.lang.StringtoString()Prints the immutable valueInvokableDeclarationwith attribute values.ImmutableTrees.InvokableDeclarationwithName(Trees.Identifier value)Copy the current immutable object by setting a value for thenameattribute.ImmutableTrees.InvokableDeclarationwithParameters(java.lang.Iterable<? extends Trees.Parameter> elements)Copy the current immutable object with elements that replace the content ofparameters.ImmutableTrees.InvokableDeclarationwithParameters(Trees.Parameter... elements)Copy the current immutable object with elements that replace the content ofparameters.
-
-
-
Field Detail
-
name
private final Trees.Identifier name
-
parameters
private final com.google.common.collect.ImmutableList<Trees.Parameter> parameters
-
-
Constructor Detail
-
InvokableDeclaration
private InvokableDeclaration(Trees.Identifier name, com.google.common.collect.ImmutableList<Trees.Parameter> parameters)
-
-
Method Detail
-
name
public Trees.Identifier name()
- Specified by:
namein interfaceTrees.Named- Returns:
- The value of the
nameattribute
-
parameters
public com.google.common.collect.ImmutableList<Trees.Parameter> parameters()
- Specified by:
parametersin interfaceTrees.InvokableDeclaration- Returns:
- The value of the
parametersattribute
-
withName
public final ImmutableTrees.InvokableDeclaration withName(Trees.Identifier value)
Copy the current immutable object by setting a value for thenameattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withParameters
public final ImmutableTrees.InvokableDeclaration withParameters(Trees.Parameter... elements)
Copy the current immutable object with elements that replace the content ofparameters.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withParameters
public final ImmutableTrees.InvokableDeclaration withParameters(java.lang.Iterable<? extends Trees.Parameter> elements)
Copy the current immutable object with elements that replace the content ofparameters. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of parameters elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofInvokableDeclarationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.InvokableDeclaration another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,parameters.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueInvokableDeclarationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.InvokableDeclaration copyOf(Trees.InvokableDeclaration instance)
Creates an immutable copy of aTrees.InvokableDeclarationvalue. 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 InvokableDeclaration instance
-
builder
public static ImmutableTrees.InvokableDeclaration.Builder builder()
Creates a builder forInvokableDeclaration.ImmutableTrees.InvokableDeclaration.builder() .name(org.immutables.generator.processor.Trees.Identifier) // requiredname.addParameters|addAllParameters(org.immutables.generator.processor.Trees.Parameter) //parameterselements .build();- Returns:
- A new InvokableDeclaration builder
-
-