Interface TypeConversion<T>

    • Method Detail

      • typeMapping

        TypeConversion.TypeMapping typeMapping()
        Type mapping from the source type to the target type.
        Returns:
        the type mapping.
      • convert

        T convert​(org.apache.avro.Schema fieldSchema,
                  @NotNull
                  java.lang.Object fieldValue)
        Convert value from the source type to the target type. Runtime exceptions are thrown on invalid argument or conversion failure.
        Parameters:
        fieldSchema - avro schema to loop up the source schema
        fieldValue - value in the source type. The value cannot be null.
        Returns:
        the converted value
      • ensureInputValueType

        static void ensureInputValueType​(java.lang.String conversionName,
                                         java.lang.Object input,
                                         java.lang.Class<?> expectedType)
        Validate the input is the expected type
        Parameters:
        conversionName - class name of type
        input - value to convert
        expectedType - expected class of type
        Throws:
        java.lang.IllegalArgumentException - if type mismatches
      • getArray

        static byte[] getArray​(java.nio.ByteBuffer buffer)
      • getArray

        static byte[] getArray​(java.nio.ByteBuffer buffer,
                               int position,
                               int length)