Class CodecLookup

java.lang.Object
io.deephaven.engine.table.impl.CodecLookup

public class CodecLookup extends Object
Utility class to concentrate ObjectCodec lookups.
  • Constructor Details

    • CodecLookup

      public CodecLookup()
  • Method Details

    • codecRequired

      public static boolean codecRequired(@NotNull @NotNull ColumnDefinition<?> columnDefinition)
      Test whether a codec is required to write or read the supplied ColumnDefinition.
      Parameters:
      columnDefinition - The ColumnDefinition
      Returns:
      Whether a codec is required
    • codecRequired

      public static boolean codecRequired(@NotNull @NotNull Class<?> dataType, @Nullable @Nullable Class<?> componentType)
      Test whether a codec is required to write or read the supplied types.
      Parameters:
      dataType - The data type to check
      componentType - The component type to check, for array and Vector types
      Returns:
      Whether a codec is required
    • explicitCodecPresent

      public static boolean explicitCodecPresent(String codecClassName)
      Test whether an explicit codec has been set.
      Parameters:
      codecClassName - The codec class name
      Returns:
      Whether an explicit codec has been set
    • lookup

      public static <TYPE> ObjectCodec<TYPE> lookup(@NotNull @NotNull ColumnDefinition<TYPE> columnDefinition, @NotNull @NotNull ColumnToCodecMappings codecMappings)
      Lookup an ObjectCodec for the supplied ColumnDefinition. Assumes that the data type is appropriate for use with a codec, i.e. that codecRequired(Class, Class) will return false.
      Parameters:
      columnDefinition - The ColumnDefinition
      Returns:
      The ObjectCodec
    • lookup

      public static <TYPE> ObjectCodec<TYPE> lookup(@NotNull @NotNull Class<TYPE> dataType, String codecClassName, String codecArguments)
      Lookup an ObjectCodec for the supplied data type, codec class name, and arguments. Assumes that the data type is appropriate for use with a codec, i.e. that codecRequired(Class, Class) will return false.
      Parameters:
      dataType - The data type
      codecClassName - The codec class name
      codecArguments - The codec arguments in string form
      Returns:
      The ObjectCodec
    • getDefaultCodec

      public static <TYPE> ObjectCodec<TYPE> getDefaultCodec(@NotNull @NotNull Class<TYPE> dataType)
      Get the default codec for the supplied data type.
      Parameters:
      dataType - The data type
      Returns:
      The default ObjectCodec