public final class Literal extends LeafExpression
Only supports primitive data types, see Delta Transaction Log Protocol: Primitive Types.
Modifier and Type | Field and Description |
---|---|
static Literal |
False |
static Literal |
True |
Modifier and Type | Method and Description |
---|---|
DataType |
dataType() |
boolean |
equals(Object o) |
Object |
eval(RowRecord record) |
int |
hashCode() |
static Literal |
of(java.math.BigDecimal value) |
static Literal |
of(boolean value) |
static Literal |
of(byte value) |
static Literal |
of(byte[] value) |
static Literal |
of(java.sql.Date value) |
static Literal |
of(double value) |
static Literal |
of(float value) |
static Literal |
of(int value) |
static Literal |
of(long value) |
static Literal |
of(short value) |
static Literal |
of(String value) |
static Literal |
of(java.sql.Timestamp value) |
static Literal |
ofNull(DataType dataType) |
String |
toString() |
Object |
value() |
children, references
public Object value()
public Object eval(RowRecord record)
record
- the input record to evaluate.RowRecord
.public DataType dataType()
DataType
of the result of evaluating this expression.public String toString()
toString
in interface Expression
toString
in class Object
public boolean equals(Object o)
equals
in class LeafExpression
public int hashCode()
hashCode
in class LeafExpression
public static Literal of(int value)
Literal
with data type IntegerType
public static Literal of(boolean value)
Literal
with data type BooleanType
public static Literal of(byte[] value)
Literal
with data type BinaryType
public static Literal of(java.math.BigDecimal value)
Literal
with data type DecimalType
with precision and scale
inferred from value
public static Literal of(double value)
Literal
with data type DoubleType
public static Literal of(String value)
Literal
with data type StringType
public static Literal of(java.sql.Timestamp value)
Literal
with data type TimestampType