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 implementation of
Trees.If.
Use the builder to create immutable instances:
ImmutableTrees.If.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTrees.If.Builderbuilder()Creates a builder forIf.static ImmutableTrees.IfCreates an immutable copy of aTrees.Ifvalue.booleanThis 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.toString()Prints the immutable valueIfwith attribute values.final ImmutableTrees.IfwithCondition(Trees.Expression value) Copy the current immutable object by setting a value for theconditionattribute.
-
Field Details
-
condition
-
-
Constructor Details
-
If
-
-
Method Details
-
condition
- Specified by:
conditionin interfaceTrees.Conditional- Returns:
- The value of the
conditionattribute
-
withCondition
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
This instance is equal to all instances ofIfthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:condition. -
toString
Prints the immutable valueIfwith attribute values. -
copyOf
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
Creates a builder forIf.ImmutableTrees.If.builder() .condition(org.immutables.generator.processor.Trees.Expression) // requiredcondition.build();- Returns:
- A new If builder
-