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 java.lang.Object implements Trees.Parameter
Immutable implementation ofTrees.Parameter.Use the builder to create immutable instances:
ImmutableTrees.Parameter.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.Parameter.BuilderBuilds instances of typeParameter.
-
Field Summary
Fields Modifier and Type Field Description private Trees.Identifiernameprivate Trees.TypeReferencetype
-
Constructor Summary
Constructors Modifier Constructor Description privateParameter(Trees.Identifier name, Trees.TypeReference type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.Parameter.Builderbuilder()Creates a builder forParameter.static ImmutableTrees.ParametercopyOf(Trees.Parameter instance)Creates an immutable copy of aTrees.Parametervalue.booleanequals(java.lang.Object another)This 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.Trees.Identifiername()java.lang.StringtoString()Prints the immutable valueParameterwith attribute values.Trees.TypeReferencetype()ImmutableTrees.ParameterwithName(Trees.Identifier value)Copy the current immutable object by setting a value for thenameattribute.ImmutableTrees.ParameterwithType(Trees.TypeReference value)Copy the current immutable object by setting a value for thetypeattribute.
-
-
-
Field Detail
-
name
private final Trees.Identifier name
-
type
private final Trees.TypeReference type
-
-
Constructor Detail
-
Parameter
private Parameter(Trees.Identifier name, Trees.TypeReference type)
-
-
Method Detail
-
name
public Trees.Identifier name()
- Specified by:
namein interfaceTrees.Named- Returns:
- The value of the
nameattribute
-
type
public Trees.TypeReference type()
- Specified by:
typein interfaceTrees.Typed- Returns:
- The value of the
typeattribute
-
withName
public final ImmutableTrees.Parameter 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
-
withType
public final ImmutableTrees.Parameter withType(Trees.TypeReference value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofParameterthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.Parameter another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,type.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueParameterwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.Parameter copyOf(Trees.Parameter instance)
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
public static ImmutableTrees.Parameter.Builder 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
-
-