Class Literals
java.lang.Object
org.apache.gravitino.rel.expressions.literals.Literals
The helper class to create literals to pass into Apache Gravitino.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Creates a literal with the given type value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Literal<Types.NullType>
Used to represent a null literal. -
Method Summary
Modifier and TypeMethodDescriptionstatic Literals.LiteralImpl<Boolean>
booleanLiteral
(Boolean value) Creates a boolean type literal with the given value.static Literals.LiteralImpl<Byte>
byteLiteral
(Byte value) Creates a byte type literal with the given value.static Literals.LiteralImpl<LocalDate>
dateLiteral
(String value) Creates a date type literal with the given value.static Literals.LiteralImpl<LocalDate>
dateLiteral
(LocalDate value) Creates a date type literal with the given value.static Literals.LiteralImpl<Decimal>
decimalLiteral
(Decimal value) Creates a decimal type literal with the given value.static Literals.LiteralImpl<Double>
doubleLiteral
(Double value) Creates a double type literal with the given value.static Literals.LiteralImpl<Float>
floatLiteral
(Float value) Creates a float type literal with the given value.static Literals.LiteralImpl<Integer>
integerLiteral
(Integer value) Creates an integer type literal with the given value.static Literals.LiteralImpl<Long>
longLiteral
(Long value) Creates a long type literal with the given value.static <T> Literals.LiteralImpl<T>
Creates a literal with the given value and data type.static Literals.LiteralImpl<Short>
shortLiteral
(Short value) Creates a short type literal with the given value.static Literals.LiteralImpl<String>
stringLiteral
(String value) Creates a string type literal with the given value.static Literals.LiteralImpl<LocalTime>
timeLiteral
(String value) Creates a time type literal with the given value.static Literals.LiteralImpl<LocalTime>
timeLiteral
(LocalTime value) Creates a time type literal with the given value.static Literals.LiteralImpl<LocalDateTime>
timestampLiteral
(String value) Creates a timestamp type literal with the given value.static Literals.LiteralImpl<LocalDateTime>
timestampLiteral
(LocalDateTime value) Creates a timestamp type literal with the given value.static Literals.LiteralImpl<Short>
unsignedByteLiteral
(Short value) Creates an unsigned byte type literal with the given value.static Literals.LiteralImpl<Long>
unsignedIntegerLiteral
(Long value) Creates an unsigned integer type literal with the given value.static Literals.LiteralImpl<Decimal>
unsignedLongLiteral
(Decimal value) Creates an unsigned long type literal with the given value.static Literals.LiteralImpl<Integer>
unsignedShortLiteral
(Integer value) Creates an unsigned short type literal with the given value.static Literals.LiteralImpl<String>
varcharLiteral
(int length, String value) Creates a varchar type literal with the given value.
-
Field Details
-
NULL
Used to represent a null literal.
-
-
Method Details
-
of
Creates a literal with the given value and data type.- Type Parameters:
T
- the JVM type of value held by the literal- Parameters:
value
- the literal valuedataType
- the data type of the literal- Returns:
- a new
Literal
instance
-
booleanLiteral
Creates a boolean type literal with the given value.- Parameters:
value
- the boolean literal value- Returns:
- a new
Literal
instance
-
byteLiteral
Creates a byte type literal with the given value.- Parameters:
value
- the byte literal value- Returns:
- a new
Literal
instance
-
unsignedByteLiteral
Creates an unsigned byte type literal with the given value.- Parameters:
value
- the unsigned byte literal value- Returns:
- a new
Literal
instance
-
shortLiteral
Creates a short type literal with the given value.- Parameters:
value
- the short literal value- Returns:
- a new
Literal
instance
-
unsignedShortLiteral
Creates an unsigned short type literal with the given value.- Parameters:
value
- the unsigned short literal value- Returns:
- a new
Literal
instance
-
integerLiteral
Creates an integer type literal with the given value.- Parameters:
value
- the integer literal value- Returns:
- a new
Literal
instance
-
unsignedIntegerLiteral
Creates an unsigned integer type literal with the given value.- Parameters:
value
- the unsigned integer literal value- Returns:
- a new
Literal
instance
-
longLiteral
Creates a long type literal with the given value.- Parameters:
value
- the long literal value- Returns:
- a new
Literal
instance
-
unsignedLongLiteral
Creates an unsigned long type literal with the given value.- Parameters:
value
- the unsigned long literal value- Returns:
- a new
Literal
instance
-
floatLiteral
Creates a float type literal with the given value.- Parameters:
value
- the float literal value- Returns:
- a new
Literal
instance
-
doubleLiteral
Creates a double type literal with the given value.- Parameters:
value
- the double literal value- Returns:
- a new
Literal
instance
-
decimalLiteral
Creates a decimal type literal with the given value.- Parameters:
value
- the decimal literal value- Returns:
- a new
Literal
instance
-
dateLiteral
Creates a date type literal with the given value.- Parameters:
value
- the date literal value- Returns:
- a new
Literal
instance
-
dateLiteral
Creates a date type literal with the given value.- Parameters:
value
- the date literal value, must be in the format "yyyy-MM-dd"- Returns:
- a new
Literal
instance
-
timeLiteral
Creates a time type literal with the given value.- Parameters:
value
- the time literal value- Returns:
- a new
Literal
instance
-
timeLiteral
Creates a time type literal with the given value.- Parameters:
value
- the time literal value, must be in the format "HH:mm:ss"- Returns:
- a new
Literal
instance
-
timestampLiteral
Creates a timestamp type literal with the given value.- Parameters:
value
- the timestamp literal value- Returns:
- a new
Literal
instance
-
timestampLiteral
Creates a timestamp type literal with the given value.- Parameters:
value
- the timestamp literal value, must be in the format "yyyy-MM-ddTHH:mm:ss"- Returns:
- a new
Literal
instance
-
stringLiteral
Creates a string type literal with the given value.- Parameters:
value
- the string literal value- Returns:
- a new
Literal
instance
-
varcharLiteral
Creates a varchar type literal with the given value.- Parameters:
value
- the string literal valuelength
- the length of the varchar- Returns:
- a new
Literal
instance
-