org.apache.avro

## Class LogicalTypes.Decimal

- java.lang.Object
- - org.apache.avro.LogicalType
  - - org.apache.avro.LogicalTypes.Decimal

- Enclosing class:
    LogicalTypes

      public static class LogicalTypes.Decimal
      extends LogicalType

  Decimal represents arbitrary-precision fixed-scale decimal numbers

- - ### Field Summary

    - ### Fields inherited from class org.apache.avro.LogicalType

      `LOGICAL_TYPE_PROP`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Schema` | `addToSchema(Schema schema)` Add this logical type to the given Schema.
    `boolean` | `equals(Object o)`
    `int` | `getPrecision()`
    `int` | `getScale()`
    `int` | `hashCode()`
    `void` | `validate(Schema schema)` Validate this logical type for the given Schema.

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

      `getName`

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

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

- - ### Method Detail

    - #### addToSchema

          public Schema addToSchema(Schema schema)

      Description copied from class: `LogicalType`
      Add this logical type to the given Schema.

      The "logicalType" property will be set to this type's name, and other type-specific properties may be added. The Schema is first validated to ensure it is compatible.

      Overrides:
        `addToSchema` in class `LogicalType`
      Parameters:
        `schema` - a Schema
      Returns:
        the modified Schema

    - #### getPrecision

          public int getPrecision()

    - #### getScale

          public int getScale()

    - #### validate

          public void validate(Schema schema)

      Description copied from class: `LogicalType`
      Validate this logical type for the given Schema.

      This will throw an exception if the Schema is incompatible with this type. For example, a date is stored as an int and is incompatible with a fixed Schema.

      Overrides:
        `validate` in class `LogicalType`
      Parameters:
        `schema` - a Schema

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

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