Class ImmutableTrees.ElseIf
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.ElseIf
-
- All Implemented Interfaces:
Trees.Conditional,Trees.Directive,Trees.DirectiveStart,Trees.ElseIf,Trees.Otherwise,Trees.TemplatePart
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.ElseIf extends java.lang.Object implements Trees.ElseIf
Immutable implementation ofTrees.ElseIf.Use the builder to create immutable instances:
ImmutableTrees.ElseIf.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.ElseIf.BuilderBuilds instances of typeElseIf.
-
Field Summary
Fields Modifier and Type Field Description private Trees.Expressioncondition
-
Constructor Summary
Constructors Modifier Constructor Description privateElseIf(Trees.Expression condition)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.ElseIf.Builderbuilder()Creates a builder forElseIf.Trees.Expressioncondition()static ImmutableTrees.ElseIfcopyOf(Trees.ElseIf instance)Creates an immutable copy of aTrees.ElseIfvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofElseIfthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.ElseIf another)inthashCode()Computes a hash code from attributes:condition.java.lang.StringtoString()Prints the immutable valueElseIfwith attribute values.ImmutableTrees.ElseIfwithCondition(Trees.Expression value)Copy the current immutable object by setting a value for theconditionattribute.
-
-
-
Field Detail
-
condition
private final Trees.Expression condition
-
-
Constructor Detail
-
ElseIf
private ElseIf(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.ElseIf 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 ofElseIfthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.ElseIf 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 valueElseIfwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.ElseIf copyOf(Trees.ElseIf instance)
Creates an immutable copy of aTrees.ElseIfvalue. 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 ElseIf instance
-
builder
public static ImmutableTrees.ElseIf.Builder builder()
Creates a builder forElseIf.ImmutableTrees.ElseIf.builder() .condition(org.immutables.generator.processor.Trees.Expression) // requiredcondition.build();- Returns:
- A new ElseIf builder
-
-