public class LiteralExpression extends Expression implements org.ojai.Value
TYPE_CODE_ARRAY, TYPE_CODE_BINARY, TYPE_CODE_BOOLEAN, TYPE_CODE_BYTE, TYPE_CODE_DATE, TYPE_CODE_DECIMAL, TYPE_CODE_DOUBLE, TYPE_CODE_FLOAT, TYPE_CODE_INT, TYPE_CODE_INTERVAL, TYPE_CODE_LONG, TYPE_CODE_MAP, TYPE_CODE_NULL, TYPE_CODE_SHORT, TYPE_CODE_STRING, TYPE_CODE_TIME, TYPE_CODE_TIMESTAMP| Constructor and Description |
|---|
LiteralExpression()
Constructor for a null value.
|
LiteralExpression(boolean v)
Constructor for a boolean value.
|
LiteralExpression(byte v)
Constructor for a byte value.
|
LiteralExpression(java.nio.ByteBuffer v)
Constructor for a binary value.
|
LiteralExpression(double v)
Constructor for a double value.
|
LiteralExpression(float v)
Constructor for a float value.
|
LiteralExpression(int v)
Constructor for an int value.
|
LiteralExpression(java.util.List<java.lang.Object> v)
Constructor for a list (array) value.
|
LiteralExpression(long v)
Constructor for a long value.
|
LiteralExpression(java.util.Map<java.lang.String,java.lang.Object> v)
Constructor for a map value.
|
LiteralExpression(org.ojai.types.ODate v)
Constructor for a date value.
|
LiteralExpression(org.ojai.types.OInterval v)
Constructor for an interval value.
|
LiteralExpression(org.ojai.types.OTime v)
Constructor for a time value.
|
LiteralExpression(org.ojai.types.OTimestamp v)
Constructor for a timestamp value.
|
LiteralExpression(short v)
Constructor for a short value.
|
LiteralExpression(java.lang.String string)
Constructor for a string value.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
asJsonString() |
java.lang.String |
asJsonString(org.ojai.json.JsonOptions jsonOptions) |
org.ojai.DocumentReader |
asReader() |
void |
emitSql(java.lang.StringBuilder sb,
java.lang.String tableAlias)
Emit this expression's contribution to the string (where clause).
|
java.nio.ByteBuffer |
getBinary() |
boolean |
getBoolean() |
byte |
getByte() |
org.ojai.types.ODate |
getDate() |
int |
getDateAsInt() |
java.math.BigDecimal |
getDecimal() |
double |
getDouble() |
float |
getFloat() |
int |
getInt() |
org.ojai.types.OInterval |
getInterval() |
long |
getIntervalAsLong() |
java.util.List<java.lang.Object> |
getList() |
java.lang.String |
getLiteral()
Get the literal value in a form that can be used in SQL strings.
|
long |
getLong() |
java.util.Map<java.lang.String,java.lang.Object> |
getMap() |
java.lang.Object |
getObject() |
short |
getShort() |
java.lang.String |
getString() |
org.ojai.types.OTime |
getTime() |
int |
getTimeAsInt() |
org.ojai.types.OTimestamp |
getTimestamp() |
long |
getTimestampAsLong() |
org.ojai.Value.Type |
getType() |
boolean |
structuralEquals(Expression e)
Check to see if the two expressions are equal.
|
int |
structuralHashCode()
Generate the hash code for the Expression.
|
void |
visit(ExpressionVisitor ev)
Visit this node.
|
gatherExpressions, toStringpublic LiteralExpression()
public LiteralExpression(boolean v)
v - the valuepublic LiteralExpression(int v)
v - the valuepublic LiteralExpression(byte v)
v - the valuepublic LiteralExpression(short v)
v - the valuepublic LiteralExpression(long v)
v - the valuepublic LiteralExpression(java.lang.String string)
string - the string valuepublic LiteralExpression(org.ojai.types.ODate v)
v - the valuepublic LiteralExpression(org.ojai.types.OTime v)
v - the valuepublic LiteralExpression(org.ojai.types.OTimestamp v)
v - the valuepublic LiteralExpression(org.ojai.types.OInterval v)
v - the valuepublic LiteralExpression(java.nio.ByteBuffer v)
v - the valuepublic LiteralExpression(double v)
v - the valuepublic LiteralExpression(float v)
v - the valuepublic LiteralExpression(java.util.Map<java.lang.String,java.lang.Object> v)
v - the valuepublic LiteralExpression(java.util.List<java.lang.Object> v)
v - the valuepublic java.lang.String getLiteral()
public void emitSql(java.lang.StringBuilder sb,
java.lang.String tableAlias)
ExpressionemitSql in class Expressionsb - where to write totableAlias - the table alias to use for field namespublic boolean structuralEquals(Expression e)
ExpressionstructuralEquals in class Expressione - the other expression to compare withpublic int structuralHashCode()
ExpressionstructuralHashCode in class Expressionpublic org.ojai.DocumentReader asReader()
asReader in interface org.ojai.Valuepublic java.nio.ByteBuffer getBinary()
getBinary in interface org.ojai.Valuepublic boolean getBoolean()
getBoolean in interface org.ojai.Valuepublic byte getByte()
getByte in interface org.ojai.Valuepublic org.ojai.types.ODate getDate()
getDate in interface org.ojai.Valuepublic int getDateAsInt()
getDateAsInt in interface org.ojai.Valuepublic java.math.BigDecimal getDecimal()
getDecimal in interface org.ojai.Valuepublic double getDouble()
getDouble in interface org.ojai.Valuepublic float getFloat()
getFloat in interface org.ojai.Valuepublic int getInt()
getInt in interface org.ojai.Valuepublic org.ojai.types.OInterval getInterval()
getInterval in interface org.ojai.Valuepublic long getIntervalAsLong()
getIntervalAsLong in interface org.ojai.Valuepublic java.util.List<java.lang.Object> getList()
getList in interface org.ojai.Valuepublic long getLong()
getLong in interface org.ojai.Valuepublic java.util.Map<java.lang.String,java.lang.Object> getMap()
getMap in interface org.ojai.Valuepublic java.lang.Object getObject()
getObject in interface org.ojai.Valuepublic short getShort()
getShort in interface org.ojai.Valuepublic java.lang.String getString()
getString in interface org.ojai.Valuepublic org.ojai.types.OTime getTime()
getTime in interface org.ojai.Valuepublic int getTimeAsInt()
getTimeAsInt in interface org.ojai.Valuepublic org.ojai.types.OTimestamp getTimestamp()
getTimestamp in interface org.ojai.Valuepublic long getTimestampAsLong()
getTimestampAsLong in interface org.ojai.Valuepublic org.ojai.Value.Type getType()
getType in interface org.ojai.Valuepublic java.lang.String asJsonString()
asJsonString in interface org.ojai.JsonStringpublic java.lang.String asJsonString(org.ojai.json.JsonOptions jsonOptions)
asJsonString in interface org.ojai.JsonStringpublic void visit(ExpressionVisitor ev)
Expressionvisit in class Expressionev - the visitor