java.lang.Object
org.apache.gravitino.rel.expressions.literals.Literals

public class Literals extends Object
The helper class to create literals to pass into Apache Gravitino.
  • Field Details

  • Method Details

    • of

      public static <T> Literals.LiteralImpl<T> of(T value, Type dataType)
      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 value
      dataType - the data type of the literal
      Returns:
      a new Literal instance
    • booleanLiteral

      public static Literals.LiteralImpl<Boolean> booleanLiteral(Boolean value)
      Creates a boolean type literal with the given value.
      Parameters:
      value - the boolean literal value
      Returns:
      a new Literal instance
    • byteLiteral

      public static Literals.LiteralImpl<Byte> byteLiteral(Byte value)
      Creates a byte type literal with the given value.
      Parameters:
      value - the byte literal value
      Returns:
      a new Literal instance
    • unsignedByteLiteral

      public static Literals.LiteralImpl<Short> unsignedByteLiteral(Short value)
      Creates an unsigned byte type literal with the given value.
      Parameters:
      value - the unsigned byte literal value
      Returns:
      a new Literal instance
    • shortLiteral

      public static Literals.LiteralImpl<Short> shortLiteral(Short value)
      Creates a short type literal with the given value.
      Parameters:
      value - the short literal value
      Returns:
      a new Literal instance
    • unsignedShortLiteral

      public static Literals.LiteralImpl<Integer> unsignedShortLiteral(Integer value)
      Creates an unsigned short type literal with the given value.
      Parameters:
      value - the unsigned short literal value
      Returns:
      a new Literal instance
    • integerLiteral

      public static Literals.LiteralImpl<Integer> integerLiteral(Integer value)
      Creates an integer type literal with the given value.
      Parameters:
      value - the integer literal value
      Returns:
      a new Literal instance
    • unsignedIntegerLiteral

      public static Literals.LiteralImpl<Long> unsignedIntegerLiteral(Long value)
      Creates an unsigned integer type literal with the given value.
      Parameters:
      value - the unsigned integer literal value
      Returns:
      a new Literal instance
    • longLiteral

      public static Literals.LiteralImpl<Long> longLiteral(Long value)
      Creates a long type literal with the given value.
      Parameters:
      value - the long literal value
      Returns:
      a new Literal instance
    • unsignedLongLiteral

      public static Literals.LiteralImpl<Decimal> unsignedLongLiteral(Decimal value)
      Creates an unsigned long type literal with the given value.
      Parameters:
      value - the unsigned long literal value
      Returns:
      a new Literal instance
    • floatLiteral

      public static Literals.LiteralImpl<Float> floatLiteral(Float value)
      Creates a float type literal with the given value.
      Parameters:
      value - the float literal value
      Returns:
      a new Literal instance
    • doubleLiteral

      public static Literals.LiteralImpl<Double> doubleLiteral(Double value)
      Creates a double type literal with the given value.
      Parameters:
      value - the double literal value
      Returns:
      a new Literal instance
    • decimalLiteral

      public static Literals.LiteralImpl<Decimal> decimalLiteral(Decimal value)
      Creates a decimal type literal with the given value.
      Parameters:
      value - the decimal literal value
      Returns:
      a new Literal instance
    • dateLiteral

      public static Literals.LiteralImpl<LocalDate> dateLiteral(LocalDate value)
      Creates a date type literal with the given value.
      Parameters:
      value - the date literal value
      Returns:
      a new Literal instance
    • dateLiteral

      public static Literals.LiteralImpl<LocalDate> dateLiteral(String value)
      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

      public static Literals.LiteralImpl<LocalTime> timeLiteral(LocalTime value)
      Creates a time type literal with the given value.
      Parameters:
      value - the time literal value
      Returns:
      a new Literal instance
    • timeLiteral

      public static Literals.LiteralImpl<LocalTime> timeLiteral(String value)
      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

      public static Literals.LiteralImpl<LocalDateTime> timestampLiteral(LocalDateTime value)
      Creates a timestamp type literal with the given value.
      Parameters:
      value - the timestamp literal value
      Returns:
      a new Literal instance
    • timestampLiteral

      public static Literals.LiteralImpl<LocalDateTime> timestampLiteral(String value)
      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

      public static Literals.LiteralImpl<String> stringLiteral(String value)
      Creates a string type literal with the given value.
      Parameters:
      value - the string literal value
      Returns:
      a new Literal instance
    • varcharLiteral

      public static Literals.LiteralImpl<String> varcharLiteral(int length, String value)
      Creates a varchar type literal with the given value.
      Parameters:
      value - the string literal value
      length - the length of the varchar
      Returns:
      a new Literal instance