Package com.blazebit.expression
Class Literal
- java.lang.Object
-
- com.blazebit.expression.Literal
-
- All Implemented Interfaces:
ArithmeticExpression
,Expression
- Direct Known Subclasses:
CollectionLiteral
,EntityLiteral
,EnumLiteral
public class Literal extends Object implements ArithmeticExpression
A literal expression.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.blazebit.expression.Expression
Expression.ResultVisitor<T>, Expression.Visitor
-
-
Constructor Summary
Constructors Constructor Description Literal(ResolvedLiteral resolvedLiteral)
Creates a new literal expression from the given resolved literal.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(Expression.ResultVisitor<T> visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.void
accept(Expression.Visitor visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.boolean
equals(Object o)
ResolvedLiteral
getResolvedLiteral()
Returns the resolved literal.com.blazebit.domain.runtime.model.DomainType
getType()
Returns the domain type of this expression.Object
getValue()
Returns the resolved literal value.int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.blazebit.expression.Expression
getUsedPaths
-
-
-
-
Constructor Detail
-
Literal
public Literal(ResolvedLiteral resolvedLiteral)
Creates a new literal expression from the given resolved literal.- Parameters:
resolvedLiteral
- The resolved literal
-
-
Method Detail
-
getType
public com.blazebit.domain.runtime.model.DomainType getType()
Returns the domain type of this expression.- Specified by:
getType
in interfaceExpression
- Returns:
- the domain type of this expression
-
getResolvedLiteral
public ResolvedLiteral getResolvedLiteral()
Returns the resolved literal.- Returns:
- the resolved literal
-
getValue
public Object getValue()
Returns the resolved literal value.- Returns:
- the resolved literal value
-
accept
public void accept(Expression.Visitor visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.- Specified by:
accept
in interfaceExpression
- Parameters:
visitor
- The visitor to call visit on
-
accept
public <T> T accept(Expression.ResultVisitor<T> visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.- Specified by:
accept
in interfaceExpression
- Type Parameters:
T
- The result type- Parameters:
visitor
- The visitor to call visit on- Returns:
- the value as returned by the result visitor
-
-