Interface Literal<T>
- 
- Type Parameters:
- T- The Java type of the value wrapped by a- Literal
 - All Superinterfaces:
- java.io.Serializable
 
 public interface Literal<T> extends java.io.SerializableRepresents a literal fixed value in an expression predicate
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Comparator<T>comparator()Return aComparatorfor values.static Literal<java.lang.Boolean>of(boolean value)static Literal<java.nio.ByteBuffer>of(byte[] value)static Literal<java.lang.Double>of(double value)static Literal<java.lang.Float>of(float value)static Literal<java.lang.Integer>of(int value)static Literal<java.lang.Long>of(long value)static Literal<java.lang.CharSequence>of(java.lang.CharSequence value)static Literal<java.math.BigDecimal>of(java.math.BigDecimal value)static Literal<java.nio.ByteBuffer>of(java.nio.ByteBuffer value)static Literal<java.util.UUID>of(java.util.UUID value)<X> Literal<X>to(Type type)Converts this literal to a literal of the given type.default java.nio.ByteBuffertoByteBuffer()Serializes the value wrapped by this literal to binary using the single-value serialization format described in the Iceberg table specification.Tvalue()Returns the value wrapped by this literal.
 
- 
- 
- 
Method Detail- 
ofstatic Literal<java.lang.Boolean> of(boolean value) 
 - 
ofstatic Literal<java.lang.Integer> of(int value) 
 - 
ofstatic Literal<java.lang.Long> of(long value) 
 - 
ofstatic Literal<java.lang.Float> of(float value) 
 - 
ofstatic Literal<java.lang.Double> of(double value) 
 - 
ofstatic Literal<java.lang.CharSequence> of(java.lang.CharSequence value) 
 - 
ofstatic Literal<java.util.UUID> of(java.util.UUID value) 
 - 
ofstatic Literal<java.nio.ByteBuffer> of(byte[] value) 
 - 
ofstatic Literal<java.nio.ByteBuffer> of(java.nio.ByteBuffer value) 
 - 
ofstatic Literal<java.math.BigDecimal> of(java.math.BigDecimal value) 
 - 
valueT value() Returns the value wrapped by this literal.
 - 
to<X> Literal<X> to(Type type) Converts this literal to a literal of the given type.When a predicate is bound to a concrete data column, literals are converted to match the bound column's type. This conversion process is more narrow than a cast and is only intended for cases where substituting one type is a common mistake (e.g. 34 instead of 34L) or where this API avoids requiring a concrete class (e.g., dates). If conversion to a target type is not supported, this method returns null. This method may return Literals.aboveMax()orLiterals.belowMin()when the target type is not as wide as the original type. These values indicate that the containing predicate can be simplified. For example, Integer.MAX_VALUE+1 converted to an int will result inaboveMaxand can simplify a < Integer.MAX_VALUE+1 toExpressions.alwaysTrue()- Type Parameters:
- X- The Java type of value the new literal contains
- Parameters:
- type- A primitive- Type
- Returns:
- A literal of the given type or null if conversion was not valid
 
 - 
comparatorjava.util.Comparator<T> comparator() Return aComparatorfor values.- Returns:
- a comparator for T objects
 
 - 
toByteBufferdefault java.nio.ByteBuffer toByteBuffer() Serializes the value wrapped by this literal to binary using the single-value serialization format described in the Iceberg table specification.- Returns:
- a ByteBuffer that contains the serialized literal value.
 
 
- 
 
-