Package io.deephaven.engine.table.impl
Class CodecLookup
java.lang.Object
io.deephaven.engine.table.impl.CodecLookup
Utility class to concentrate
ObjectCodec lookups.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancodecRequired(@NotNull ColumnDefinition<?> columnDefinition) Test whether a codec is required to write or read the suppliedColumnDefinition.static booleancodecRequired(@NotNull Class<?> dataType, @Nullable Class<?> componentType) Test whether a codec is required to write or read the supplied types.static booleanexplicitCodecPresent(String codecClassName) Test whether an explicit codec has been set.static <TYPE> ObjectCodec<TYPE>getDefaultCodec(@NotNull Class<TYPE> dataType) Get the default codec for the supplied data type.static <TYPE> ObjectCodec<TYPE>lookup(@NotNull ColumnDefinition<TYPE> columnDefinition, @NotNull ColumnToCodecMappings codecMappings) Lookup anObjectCodecfor the suppliedColumnDefinition.static <TYPE> ObjectCodec<TYPE>Lookup anObjectCodecfor the supplied data type, codec class name, and arguments.
-
Constructor Details
-
CodecLookup
public CodecLookup()
-
-
Method Details
-
codecRequired
Test whether a codec is required to write or read the suppliedColumnDefinition.- Parameters:
columnDefinition- TheColumnDefinition- 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 checkcomponentType- The component type to check, for array andVectortypes- Returns:
- Whether a codec is required
-
explicitCodecPresent
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 anObjectCodecfor the suppliedColumnDefinition. Assumes that the data type is appropriate for use with a codec, i.e. thatcodecRequired(Class, Class)will return false.- Parameters:
columnDefinition- TheColumnDefinition- Returns:
- The
ObjectCodec
-
lookup
public static <TYPE> ObjectCodec<TYPE> lookup(@NotNull @NotNull Class<TYPE> dataType, String codecClassName, String codecArguments) Lookup anObjectCodecfor the supplied data type, codec class name, and arguments. Assumes that the data type is appropriate for use with a codec, i.e. thatcodecRequired(Class, Class)will return false.- Parameters:
dataType- The data typecodecClassName- The codec class namecodecArguments- The codec arguments in string form- Returns:
- The
ObjectCodec
-
getDefaultCodec
Get the default codec for the supplied data type.- Parameters:
dataType- The data type- Returns:
- The default
ObjectCodec
-