Package hydra.typeScript.syntax
Class IfStatement
- java.lang.Object
-
- hydra.typeScript.syntax.IfStatement
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<IfStatement>
public class IfStatement extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<IfStatement>
An if statement- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIfStatement.BuilderA fluent builder forIfStatement.
-
Field Summary
Fields Modifier and Type Field Description Optional<Statement>alternatestatic NameALTERNATEName of thehydra.typeScript.syntax.IfStatement.alternatefield.Statementconsequentstatic NameCONSEQUENTName of thehydra.typeScript.syntax.IfStatement.consequentfield.Expressionteststatic NameTESTName of thehydra.typeScript.syntax.IfStatement.testfield.static NameTYPE_Name of thehydra.typeScript.syntax.IfStatementtype.
-
Constructor Summary
Constructors Constructor Description IfStatement(Expression test, Statement consequent, Optional<Statement> alternate)Constructs an immutableIfStatement.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IfStatement.Builderbuilder()Creates a new fluent builder forIfStatement.intcompareTo(IfStatement other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()IfStatementwithAlternate(Optional<Statement> alternate)Returns a copy of thisIfStatementwithalternatereplaced.IfStatementwithConsequent(Statement consequent)Returns a copy of thisIfStatementwithconsequentreplaced.IfStatementwithTest(Expression test)Returns a copy of thisIfStatementwithtestreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.typeScript.syntax.IfStatementtype.
-
TEST
public static final Name TEST
Name of thehydra.typeScript.syntax.IfStatement.testfield.
-
CONSEQUENT
public static final Name CONSEQUENT
Name of thehydra.typeScript.syntax.IfStatement.consequentfield.
-
ALTERNATE
public static final Name ALTERNATE
Name of thehydra.typeScript.syntax.IfStatement.alternatefield.
-
test
public final Expression test
-
consequent
public final Statement consequent
-
-
Constructor Detail
-
IfStatement
public IfStatement(Expression test, Statement consequent, Optional<Statement> alternate)
Constructs an immutableIfStatement.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(IfStatement other)
- Specified by:
compareToin interfacejava.lang.Comparable<IfStatement>
-
withTest
public IfStatement withTest(Expression test)
Returns a copy of thisIfStatementwithtestreplaced.
-
withConsequent
public IfStatement withConsequent(Statement consequent)
Returns a copy of thisIfStatementwithconsequentreplaced.
-
withAlternate
public IfStatement withAlternate(Optional<Statement> alternate)
Returns a copy of thisIfStatementwithalternatereplaced.
-
builder
public static IfStatement.Builder builder()
Creates a new fluent builder forIfStatement.
-
-