Class VariableScaleDecimal


  • public class VariableScaleDecimal
    extends Object
    An arbitrary precision decimal value with variable scale.
    Author:
    Jiri Pechanec
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.kafka.connect.data.SchemaBuilder builder()
      Returns a SchemaBuilder for a VariableScaleDecimal.
      static org.apache.kafka.connect.data.Struct fromLogical​(org.apache.kafka.connect.data.Schema schema, SpecialValueDecimal value)
      Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.
      static org.apache.kafka.connect.data.Struct fromLogical​(org.apache.kafka.connect.data.Schema schema, BigDecimal decimalValue)
      Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.
      static org.apache.kafka.connect.data.Schema optionalSchema()
      Returns a Schema for an optional VariableScaleDecimal but with all other default Schema settings.
      static org.apache.kafka.connect.data.Schema schema()
      Returns a Schema for a VariableScaleDecimal but with all other default Schema settings.
      static SpecialValueDecimal toLogical​(org.apache.kafka.connect.data.Struct value)
      Decodes the encoded value - see fromLogical(Schema, BigDecimal) for encoding format
    • Constructor Detail

      • VariableScaleDecimal

        public VariableScaleDecimal()
    • Method Detail

      • builder

        public static org.apache.kafka.connect.data.SchemaBuilder builder()
        Returns a SchemaBuilder for a VariableScaleDecimal. You can use the resulting SchemaBuilder to set additional schema settings such as required/optional, default value, and documentation.
        Returns:
        the schema builder
      • schema

        public static org.apache.kafka.connect.data.Schema schema()
        Returns a Schema for a VariableScaleDecimal but with all other default Schema settings.
        Returns:
        the schema
        See Also:
        builder()
      • optionalSchema

        public static org.apache.kafka.connect.data.Schema optionalSchema()
        Returns a Schema for an optional VariableScaleDecimal but with all other default Schema settings.
        Returns:
        the schema
        See Also:
        builder()
      • fromLogical

        public static org.apache.kafka.connect.data.Struct fromLogical​(org.apache.kafka.connect.data.Schema schema,
                                                                       SpecialValueDecimal value)
        Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.
        Parameters:
        schema - of the encoded value
        value - the value or the decimal
        Returns:
        the encoded value
      • fromLogical

        public static org.apache.kafka.connect.data.Struct fromLogical​(org.apache.kafka.connect.data.Schema schema,
                                                                       BigDecimal decimalValue)
        Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.
        Parameters:
        schema - of the encoded value
        value - the value or the decimal
        Returns:
        the encoded value
      • toLogical

        public static SpecialValueDecimal toLogical​(org.apache.kafka.connect.data.Struct value)
        Decodes the encoded value - see fromLogical(Schema, BigDecimal) for encoding format
        Parameters:
        value - the encoded value
        Returns:
        the decoded value