Class ImmutableTrees.If
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.If
-
- All Implemented Interfaces:
Trees.Conditional,Trees.Directive,Trees.DirectiveStart,Trees.If,Trees.TemplatePart
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.If extends java.lang.Object implements Trees.If
Immutable implementation ofTrees.If.Use the builder to create immutable instances:
ImmutableTrees.If.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.If.BuilderBuilds instances of typeIf.
-
Field Summary
Fields Modifier and Type Field Description private Trees.Expressioncondition
-
Constructor Summary
Constructors Modifier Constructor Description privateIf(Trees.Expression condition)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.If.Builderbuilder()Creates a builder forIf.Trees.Expressioncondition()static ImmutableTrees.IfcopyOf(Trees.If instance)Creates an immutable copy of aTrees.Ifvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofIfthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.If another)inthashCode()Computes a hash code from attributes:condition.java.lang.StringtoString()Prints the immutable valueIfwith attribute values.ImmutableTrees.IfwithCondition(Trees.Expression value)Copy the current immutable object by setting a value for theconditionattribute.
-
-
-
Field Detail
-
condition
private final Trees.Expression condition
-
-
Constructor Detail
-
If
private If(Trees.Expression condition)
-
-
Method Detail
-
condition
public Trees.Expression condition()
- Specified by:
conditionin interfaceTrees.Conditional- Returns:
- The value of the
conditionattribute
-
withCondition
public final ImmutableTrees.If withCondition(Trees.Expression value)
Copy the current immutable object by setting a value for theconditionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for condition- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofIfthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.If another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:condition.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueIfwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.If copyOf(Trees.If instance)
Creates an immutable copy of aTrees.Ifvalue. 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 If instance
-
builder
public static ImmutableTrees.If.Builder builder()
Creates a builder forIf.ImmutableTrees.If.builder() .condition(org.immutables.generator.processor.Trees.Expression) // requiredcondition.build();- Returns:
- A new If builder
-
-