Package dev.vortex.api.expressions
Interface Literal.LiteralVisitor<U>
- Type Parameters:
U
- the return type of visitor methods
public static interface Literal.LiteralVisitor<U>
Visitor interface for processing literals in a type-safe manner.
This interface defines methods for visiting each type of literal that can be represented in the Vortex system. Implementations can provide type-specific processing logic while maintaining type safety.
-
Method Summary
Modifier and TypeMethodDescriptionvisitBoolean
(Boolean literal) Visits a boolean literal.visitBytes
(byte[] literal) Visits a byte array literal.visitDateDays
(Integer days) Visits a date literal with day precision.visitDateMillis
(Long millis) Visits a date literal with millisecond precision.visitDecimal
(BigDecimal decimal, int precision, int scale) Visits a decimal literal with specified precision and scale.visitFloat32
(Float literal) Visits a 32-bit floating-point literal.visitFloat64
(Double literal) Visits a 64-bit floating-point literal.visitInt16
(Short literal) Visits a 16-bit signed integer literal.visitInt32
(Integer literal) Visits a 32-bit signed integer literal.visitInt64
(Long literal) Visits a 64-bit signed integer literal.Visits an 8-bit signed integer literal.Visits a null literal.visitString
(String literal) Visits a string literal.visitTimeMicros
(Long seconds) Visits a time literal with microsecond precision.visitTimeMillis
(Integer seconds) Visits a time literal with millisecond precision.visitTimeNanos
(Long seconds) Visits a time literal with nanosecond precision.visitTimeSeconds
(Integer seconds) Visits a time literal with second precision.visitTimestampMicros
(Long epochMicros, Optional<String> timeZone) Visits a timestamp literal with microsecond precision.visitTimestampMillis
(Long epochMillis, Optional<String> timeZone) Visits a timestamp literal with millisecond precision.visitTimestampNanos
(Long epochNanos, Optional<String> timeZone) Visits a timestamp literal with nanosecond precision.
-
Method Details
-
visitNull
U visitNull()Visits a null literal.- Returns:
- the result of processing the null literal
-
visitBoolean
Visits a boolean literal.- Parameters:
literal
- the boolean value, may be null- Returns:
- the result of processing the boolean literal
-
visitInt8
Visits an 8-bit signed integer literal.- Parameters:
literal
- the byte value, may be null- Returns:
- the result of processing the int8 literal
-
visitInt16
Visits a 16-bit signed integer literal.- Parameters:
literal
- the short value, may be null- Returns:
- the result of processing the int16 literal
-
visitInt32
Visits a 32-bit signed integer literal.- Parameters:
literal
- the integer value, may be null- Returns:
- the result of processing the int32 literal
-
visitInt64
Visits a 64-bit signed integer literal.- Parameters:
literal
- the long value, may be null- Returns:
- the result of processing the int64 literal
-
visitDateDays
Visits a date literal with day precision.- Parameters:
days
- the number of days since Unix epoch, may be null- Returns:
- the result of processing the date literal
-
visitDateMillis
Visits a date literal with millisecond precision.- Parameters:
millis
- the number of milliseconds since Unix epoch, may be null- Returns:
- the result of processing the date literal
-
visitTimeSeconds
Visits a time literal with second precision.- Parameters:
seconds
- the time in seconds since midnight, may be null- Returns:
- the result of processing the time literal
-
visitTimeMillis
Visits a time literal with millisecond precision.- Parameters:
seconds
- the time in milliseconds since midnight, may be null- Returns:
- the result of processing the time literal
-
visitTimeMicros
Visits a time literal with microsecond precision.- Parameters:
seconds
- the time in microseconds since midnight, may be null- Returns:
- the result of processing the time literal
-
visitTimeNanos
Visits a time literal with nanosecond precision.- Parameters:
seconds
- the time in nanoseconds since midnight, may be null- Returns:
- the result of processing the time literal
-
visitTimestampMillis
Visits a timestamp literal with millisecond precision.- Parameters:
epochMillis
- the timestamp in milliseconds since Unix epoch, may be nulltimeZone
- the time zone identifier, optional- Returns:
- the result of processing the timestamp literal
-
visitTimestampMicros
Visits a timestamp literal with microsecond precision.- Parameters:
epochMicros
- the timestamp in microseconds since Unix epoch, may be nulltimeZone
- the time zone identifier, optional- Returns:
- the result of processing the timestamp literal
-
visitTimestampNanos
Visits a timestamp literal with nanosecond precision.- Parameters:
epochNanos
- the timestamp in nanoseconds since Unix epoch, may be nulltimeZone
- the time zone identifier, optional- Returns:
- the result of processing the timestamp literal
-
visitFloat32
Visits a 32-bit floating-point literal.- Parameters:
literal
- the float value, may be null- Returns:
- the result of processing the float32 literal
-
visitFloat64
Visits a 64-bit floating-point literal.- Parameters:
literal
- the double value, may be null- Returns:
- the result of processing the float64 literal
-
visitDecimal
Visits a decimal literal with specified precision and scale.- Parameters:
decimal
- the decimal value, may be nullprecision
- the total number of digitsscale
- the number of digits after the decimal point- Returns:
- the result of processing the decimal literal
-
visitString
Visits a string literal.- Parameters:
literal
- the string value, may be null- Returns:
- the result of processing the string literal
-
visitBytes
Visits a byte array literal.- Parameters:
literal
- the byte array value, may be null- Returns:
- the result of processing the bytes literal
-