Enum CodecCache

java.lang.Object
java.lang.Enum<CodecCache>
com.illumon.util.codec.CodecCache
All Implemented Interfaces:
Serializable, Comparable<CodecCache>, java.lang.constant.Constable

public enum CodecCache
extends Enum<CodecCache>
Cache for ObjectCodec instances.
  • Enum Constant Details

  • Method Details

    • values

      public static CodecCache[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CodecCache valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCodec

      public <TYPE> ObjectCodec<TYPE> getCodec​(@NotNull String className, @Nullable String arguments)
      Get or create a cached ObjectCodec.
      Type Parameters:
      TYPE - The encoding type
      Parameters:
      className - The class name
      arguments - The constructor arguments
      Returns:
      The corresponding ObjectCodec
      Throws:
      CodecCacheException - If an error occurred while instantiating the named codec class from the supplied arguments
    • getDefaultCodecClass

      public static String getDefaultCodecClass​(@NotNull Class<?> dataType)
      Get the default ObjectCodec class to use for the given column type.
      Parameters:
      dataType - The column data type
      Returns:
      The name of the default ObjectCodec subclass to use for encoding the given type