Class ImmutableTrees.Parameter
java.lang.Object
org.immutables.generator.processor.ImmutableTrees.Parameter
- All Implemented Interfaces:
Trees.Named,Trees.Parameter,Trees.Typed
- Enclosing class:
ImmutableTrees
@Immutable
public static final class ImmutableTrees.Parameter
extends Object
implements Trees.Parameter
Immutable implementation of
Trees.Parameter.
Use the builder to create immutable instances:
ImmutableTrees.Parameter.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Trees.Identifierprivate final Trees.TypeReference -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forParameter.static ImmutableTrees.ParametercopyOf(Trees.Parameter instance) Creates an immutable copy of aTrees.Parametervalue.booleanThis instance is equal to all instances ofParameterthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.Parameter another) inthashCode()Computes a hash code from attributes:name,type.name()toString()Prints the immutable valueParameterwith attribute values.type()final ImmutableTrees.ParameterwithName(Trees.Identifier value) Copy the current immutable object by setting a value for thenameattribute.final ImmutableTrees.ParameterwithType(Trees.TypeReference value) Copy the current immutable object by setting a value for thetypeattribute.
-
Field Details
-
name
-
type
-
-
Constructor Details
-
Parameter
-
-
Method Details
-
name
- Specified by:
namein interfaceTrees.Named- Returns:
- The value of the
nameattribute
-
type
- Specified by:
typein interfaceTrees.Typed- Returns:
- The value of the
typeattribute
-
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
-
withType
Copy the current immutable object by setting a value for thetypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofParameterthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:name,type. -
toString
Prints the immutable valueParameterwith attribute values. -
copyOf
Creates an immutable copy of aTrees.Parametervalue. 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 Parameter instance
-
builder
Creates a builder forParameter.ImmutableTrees.Parameter.builder() .name(org.immutables.generator.processor.Trees.Identifier) // requiredname.type(org.immutables.generator.processor.Trees.TypeReference) // requiredtype.build();- Returns:
- A new Parameter builder
-