Class AbstractType

java.lang.Object
io.trino.spi.type.AbstractType
All Implemented Interfaces:
Type
Direct Known Subclasses:
AbstractIntType, AbstractLongType, AbstractVariableWidthType, ArrayType, BooleanType, DecimalType, DoubleType, MapType, RowType, SmallintType, TimestampType, TimestampWithTimeZoneType, TimeWithTimeZoneType, TinyintType, UuidType

public abstract class AbstractType extends Object implements Type
  • Constructor Details

  • Method Details

    • getTypeSignature

      public final TypeSignature getTypeSignature()
      Description copied from interface: Type
      Gets the name of this type which must be case insensitive globally unique. The name of a user defined type must be a legal identifier in Trino.
      Specified by:
      getTypeSignature in interface Type
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: Type
      Returns the name of this type that should be displayed to end-users.
      Specified by:
      getDisplayName in interface Type
    • getJavaType

      public final Class<?> getJavaType()
      Description copied from interface: Type
      Gets the Java class type used to represent this value on the stack during expression execution.

      Currently, this can be boolean, long, double, or a non-primitive type.

      Specified by:
      getJavaType in interface Type
    • getValueBlockType

      public Class<? extends ValueBlock> getValueBlockType()
      Description copied from interface: Type
      Gets the ValueBlock type used to store values of this type.
      Specified by:
      getValueBlockType in interface Type
    • getTypeParameters

      public List<Type> getTypeParameters()
      Description copied from interface: Type
      For parameterized types returns the list of parameters.
      Specified by:
      getTypeParameters in interface Type
    • isComparable

      public boolean isComparable()
      Description copied from interface: Type
      True if the type supports equalTo and hash.
      Specified by:
      isComparable in interface Type
    • isOrderable

      public boolean isOrderable()
      Description copied from interface: Type
      True if the type supports compareTo.
      Specified by:
      isOrderable in interface Type
    • getBoolean

      public boolean getBoolean(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a boolean.
      Specified by:
      getBoolean in interface Type
    • writeBoolean

      public void writeBoolean(BlockBuilder blockBuilder, boolean value)
      Description copied from interface: Type
      Writes the boolean value into the BlockBuilder.
      Specified by:
      writeBoolean in interface Type
    • getLong

      public long getLong(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a long.
      Specified by:
      getLong in interface Type
    • writeLong

      public void writeLong(BlockBuilder blockBuilder, long value)
      Description copied from interface: Type
      Writes the long value into the BlockBuilder.
      Specified by:
      writeLong in interface Type
    • getDouble

      public double getDouble(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a double.
      Specified by:
      getDouble in interface Type
    • writeDouble

      public void writeDouble(BlockBuilder blockBuilder, double value)
      Description copied from interface: Type
      Writes the double value into the BlockBuilder.
      Specified by:
      writeDouble in interface Type
    • getSlice

      public io.airlift.slice.Slice getSlice(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a Slice.
      Specified by:
      getSlice in interface Type
    • writeSlice

      public void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value)
      Description copied from interface: Type
      Writes the Slice value into the BlockBuilder.
      Specified by:
      writeSlice in interface Type
    • writeSlice

      public void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length)
      Description copied from interface: Type
      Writes the Slice value into the BlockBuilder.
      Specified by:
      writeSlice in interface Type
    • getObject

      public Object getObject(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as an Object.
      Specified by:
      getObject in interface Type
    • writeObject

      public void writeObject(BlockBuilder blockBuilder, Object value)
      Description copied from interface: Type
      Writes the Object value into the BlockBuilder.
      Specified by:
      writeObject in interface Type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object