org.apache.avro

## Class Conversions.DecimalConversion

- java.lang.Object
- - org.apache.avro.Conversion<BigDecimal>
  - - org.apache.avro.Conversions.DecimalConversion

- Enclosing class:
    Conversions

      public static class Conversions.DecimalConversion
      extends Conversion<BigDecimal>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DecimalConversion()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BigDecimal` | `fromBytes(ByteBuffer value, Schema schema, LogicalType type)`
    `BigDecimal` | `fromFixed(GenericFixed value, Schema schema, LogicalType type)`
    `Class<BigDecimal>` | `getConvertedType()` Return the Java class representing the logical type.
    `String` | `getLogicalTypeName()` Return the logical type this class converts.
    `Schema` | `getRecommendedSchema()`
    `ByteBuffer` | `toBytes(BigDecimal value, Schema schema, LogicalType type)`
    `GenericFixed` | `toFixed(BigDecimal value, Schema schema, LogicalType type)`

    - ### Methods inherited from class org.apache.avro.Conversion

      `adjustAndSetValue, fromArray, fromBoolean, fromCharSequence, fromDouble, fromEnumSymbol, fromFloat, fromInt, fromLong, fromMap, fromRecord, toArray, toBoolean, toCharSequence, toDouble, toEnumSymbol, toFloat, toInt, toLong, toMap, toRecord`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DecimalConversion

          public DecimalConversion()

  - ### Method Detail

    - #### getConvertedType

          public Class<BigDecimal> getConvertedType()

      Description copied from class: `Conversion`
      Return the Java class representing the logical type.
      Specified by:
        `getConvertedType` in class `Conversion<BigDecimal>`
      Returns:
        a Java class returned by from methods and accepted by to methods

    - #### getRecommendedSchema

          public Schema getRecommendedSchema()

      Overrides:
        `getRecommendedSchema` in class `Conversion<BigDecimal>`

    - #### getLogicalTypeName

          public String getLogicalTypeName()

      Description copied from class: `Conversion`
      Return the logical type this class converts.
      Specified by:
        `getLogicalTypeName` in class `Conversion<BigDecimal>`
      Returns:
        a String logical type name

    - #### fromBytes

          public BigDecimal fromBytes(ByteBuffer value,
                                      Schema schema,
                                      LogicalType type)

      Overrides:
        `fromBytes` in class `Conversion<BigDecimal>`

    - #### toBytes

          public ByteBuffer toBytes(BigDecimal value,
                                    Schema schema,
                                    LogicalType type)

      Overrides:
        `toBytes` in class `Conversion<BigDecimal>`

    - #### fromFixed

          public BigDecimal fromFixed(GenericFixed value,
                                      Schema schema,
                                      LogicalType type)

      Overrides:
        `fromFixed` in class `Conversion<BigDecimal>`

    - #### toFixed

          public GenericFixed toFixed(BigDecimal value,
                                      Schema schema,
                                      LogicalType type)

      Overrides:
        `toFixed` in class `Conversion<BigDecimal>`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.