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 Object
implements Trees.InvokableDeclaration
Immutable implementation of
Trees.InvokableDeclaration.
Use the builder to create immutable instances:
ImmutableTrees.InvokableDeclaration.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeInvokableDeclaration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Trees.Identifierprivate final com.google.common.collect.ImmutableList<Trees.Parameter> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInvokableDeclaration(Trees.Identifier name, com.google.common.collect.ImmutableList<Trees.Parameter> parameters) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forInvokableDeclaration.copyOf(Trees.InvokableDeclaration instance) Creates an immutable copy of aTrees.InvokableDeclarationvalue.booleanThis 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.name()com.google.common.collect.ImmutableList<Trees.Parameter> toString()Prints the immutable valueInvokableDeclarationwith attribute values.withName(Trees.Identifier value) Copy the current immutable object by setting a value for thenameattribute.withParameters(Iterable<? extends Trees.Parameter> elements) Copy the current immutable object with elements that replace the content ofparameters.withParameters(Trees.Parameter... elements) Copy the current immutable object with elements that replace the content ofparameters.
-
Field Details
-
name
-
parameters
-
-
Constructor Details
-
InvokableDeclaration
private InvokableDeclaration(Trees.Identifier name, com.google.common.collect.ImmutableList<Trees.Parameter> parameters)
-
-
Method Details
-
name
- Specified by:
namein interfaceTrees.Named- Returns:
- The value of the
nameattribute
-
parameters
- Specified by:
parametersin interfaceTrees.InvokableDeclaration- Returns:
- The value of the
parametersattribute
-
withName
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
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(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
This instance is equal to all instances ofInvokableDeclarationthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:name,parameters. -
toString
Prints the immutable valueInvokableDeclarationwith attribute values. -
copyOf
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
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
-