Class ImmutableTrees.TypeDeclaration
- java.lang.Object
-
- org.immutables.generator.processor.Trees.TypeDeclaration
-
- org.immutables.generator.processor.ImmutableTrees.TypeDeclaration
-
- All Implemented Interfaces:
Trees.TypeReference
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.TypeDeclaration extends Trees.TypeDeclaration
Immutable implementation ofTrees.TypeDeclaration.Use the builder to create immutable instances:
ImmutableTrees.TypeDeclaration.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.TypeDeclaration.BuilderBuilds instances of typeTypeDeclaration.-
Nested classes/interfaces inherited from class org.immutables.generator.processor.Trees.TypeDeclaration
Trees.TypeDeclaration.Kind
-
-
Field Summary
Fields Modifier and Type Field Description private Trees.TypeDeclaration.Kindkindprivate Trees.TypeIdentifiertype
-
Constructor Summary
Constructors Modifier Constructor Description privateTypeDeclaration(ImmutableTrees.TypeDeclaration.Builder builder)privateTypeDeclaration(Trees.TypeIdentifier type, Trees.TypeDeclaration.Kind kind)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.TypeDeclaration.Builderbuilder()Creates a builder forTypeDeclaration.static ImmutableTrees.TypeDeclarationcopyOf(Trees.TypeDeclaration instance)Creates an immutable copy of aTrees.TypeDeclarationvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofTypeDeclarationthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.TypeDeclaration another)inthashCode()Computes a hash code from attributes:type,kind.Trees.TypeDeclaration.Kindkind()java.lang.StringtoString()Prints the immutable valueTypeDeclarationwith attribute values.Trees.TypeIdentifiertype()ImmutableTrees.TypeDeclarationwithKind(Trees.TypeDeclaration.Kind value)Copy the current immutable object by setting a value for thekindattribute.ImmutableTrees.TypeDeclarationwithType(Trees.TypeIdentifier value)Copy the current immutable object by setting a value for thetypeattribute.
-
-
-
Field Detail
-
type
private final Trees.TypeIdentifier type
-
kind
private final Trees.TypeDeclaration.Kind kind
-
-
Constructor Detail
-
TypeDeclaration
private TypeDeclaration(ImmutableTrees.TypeDeclaration.Builder builder)
-
TypeDeclaration
private TypeDeclaration(Trees.TypeIdentifier type, Trees.TypeDeclaration.Kind kind)
-
-
Method Detail
-
type
public Trees.TypeIdentifier type()
- Specified by:
typein classTrees.TypeDeclaration- Returns:
- The value of the
typeattribute
-
kind
public Trees.TypeDeclaration.Kind kind()
- Overrides:
kindin classTrees.TypeDeclaration- Returns:
- The value of the
kindattribute
-
withType
public final ImmutableTrees.TypeDeclaration withType(Trees.TypeIdentifier 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
-
withKind
public final ImmutableTrees.TypeDeclaration withKind(Trees.TypeDeclaration.Kind value)
Copy the current immutable object by setting a value for thekindattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for kind- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofTypeDeclarationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.TypeDeclaration another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:type,kind.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueTypeDeclarationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.TypeDeclaration copyOf(Trees.TypeDeclaration instance)
Creates an immutable copy of aTrees.TypeDeclarationvalue. 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 TypeDeclaration instance
-
builder
public static ImmutableTrees.TypeDeclaration.Builder builder()
Creates a builder forTypeDeclaration.ImmutableTrees.TypeDeclaration.builder() .type(org.immutables.generator.processor.Trees.TypeIdentifier) // requiredtype.kind(org.immutables.generator.processor.Trees.TypeDeclaration.Kind) // optionalkind.build();- Returns:
- A new TypeDeclaration builder
-
-