Package com.exasol.sql.expression
Class BooleanLiteral
- java.lang.Object
-
- com.exasol.util.AbstractTree
-
- com.exasol.util.AbstractBottomUpTreeNode
-
- com.exasol.sql.expression.AbstractBooleanExpression
-
- com.exasol.sql.expression.BooleanLiteral
-
- All Implemented Interfaces:
BooleanExpression,ValueExpression,TreeNode
public final class BooleanLiteral extends AbstractBooleanExpression implements ValueExpression
This class represents boolean literals (read "true" and "false")
-
-
Field Summary
-
Fields inherited from class com.exasol.util.AbstractTree
children, parent
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ValueExpressionVisitor visitor)Accept a visitorvoidacceptConcrete(BooleanExpressionVisitor visitor)Sub-classes must override this method so that the visitor knows the type of the visited class at compile time.voiddismissConcrete(BooleanExpressionVisitor visitor)Sub-classes must override this method so that the visitor knows the type of the visited class at compile time.static BooleanLiteralof(boolean value)static BooleanLiteralof(String value)Create a newBooleanLiteralinstance from a String.booleantoBoolean()Get boolean value this literal represents.static BooleanExpression[]toBooleanExpressions(boolean[] values)Map an array of booleans to and array of BooleanExpressionsStringtoString()-
Methods inherited from class com.exasol.sql.expression.AbstractBooleanExpression
accept
-
Methods inherited from class com.exasol.util.AbstractBottomUpTreeNode
addChild, getRoot, setParent
-
Methods inherited from class com.exasol.util.AbstractTree
getChild, getChildren, getParent, isChild, isFirstSibling, isRoot, isSibling
-
-
-
-
Method Detail
-
of
public static BooleanLiteral of(boolean value)
-
of
public static BooleanLiteral of(String value)
Create a newBooleanLiteralinstance from a String.- Parameters:
value- the string to be turned into a literal- Returns:
- new
BooleanLiteralinstance - Throws:
IllegalArgumentException- in case the literal is not recognized.
-
toBoolean
public boolean toBoolean()
Get boolean value this literal represents.- Returns:
- boolean value.
-
acceptConcrete
public void acceptConcrete(BooleanExpressionVisitor visitor)
Description copied from class:AbstractBooleanExpressionSub-classes must override this method so that the visitor knows the type of the visited class at compile time.- Specified by:
acceptConcretein classAbstractBooleanExpression- Parameters:
visitor- visitor to accept
-
dismissConcrete
public void dismissConcrete(BooleanExpressionVisitor visitor)
Description copied from class:AbstractBooleanExpressionSub-classes must override this method so that the visitor knows the type of the visited class at compile time.- Specified by:
dismissConcretein classAbstractBooleanExpression- Parameters:
visitor- visitor to accept
-
toBooleanExpressions
public static BooleanExpression[] toBooleanExpressions(boolean[] values)
Map an array of booleans to and array of BooleanExpressions- Parameters:
values- string literals to be turned into boolean expressions- Returns:
- boolean expressions
-
accept
public void accept(ValueExpressionVisitor visitor)
Description copied from interface:ValueExpressionAccept a visitor- Specified by:
acceptin interfaceValueExpression- Overrides:
acceptin classAbstractBooleanExpression- Parameters:
visitor- visitor to accept
-
-