org.apache.avro

## Class LogicalTypes

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

-     public class LogicalTypes
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `LogicalTypes.BigDecimal`
    `static class` | `LogicalTypes.Date` Date represents a date without a time
    `static class` | `LogicalTypes.Decimal` Decimal represents arbitrary-precision fixed-scale decimal numbers
    `static class` | `LogicalTypes.LocalTimestampMicros`
    `static class` | `LogicalTypes.LocalTimestampMillis`
    `static interface` | `LogicalTypes.LogicalTypeFactory` Factory interface and SPI for logical types.
    `static class` | `LogicalTypes.TimeMicros` TimeMicros represents a time in microseconds without a date
    `static class` | `LogicalTypes.TimeMillis` TimeMillis represents a time in milliseconds without a date
    `static class` | `LogicalTypes.TimestampMicros` TimestampMicros represents a date and time in microseconds
    `static class` | `LogicalTypes.TimestampMillis` TimestampMillis represents a date and time in milliseconds

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogicalTypes()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LogicalTypes.BigDecimal` | `bigDecimal()` Create a Big Decimal LogicalType that can accept any precision and scale
    `static LogicalTypes.Date` | `date()`
    `static LogicalTypes.Decimal` | `decimal(int precision)` Create a Decimal LogicalType with the given precision and scale 0
    `static LogicalTypes.Decimal` | `decimal(int precision, int scale)` Create a Decimal LogicalType with the given precision and scale
    `static LogicalType` | `fromSchema(Schema schema)` Returns the `LogicalType` from the schema, if one is present.
    `static LogicalType` | `fromSchemaIgnoreInvalid(Schema schema)`
    `static Map<String,LogicalTypes.LogicalTypeFactory>` | `getCustomRegisteredTypes()` Return an unmodifiable map of any registered custom `LogicalType`
    `static LogicalTypes.LocalTimestampMicros` | `localTimestampMicros()`
    `static LogicalTypes.LocalTimestampMillis` | `localTimestampMillis()`
    `static void` | `register(LogicalTypes.LogicalTypeFactory factory)` Register a logical type.
    `static void` | `register(String logicalTypeName, LogicalTypes.LogicalTypeFactory factory)` Register a logical type.
    `static LogicalTypes.TimeMicros` | `timeMicros()`
    `static LogicalTypes.TimeMillis` | `timeMillis()`
    `static LogicalTypes.TimestampMicros` | `timestampMicros()`
    `static LogicalTypes.TimestampMillis` | `timestampMillis()`
    `static LogicalType` | `uuid()`

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

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

- - ### Constructor Detail

    - #### LogicalTypes

          public LogicalTypes()

  - ### Method Detail

    - #### register

          public static void register(LogicalTypes.LogicalTypeFactory factory)

      Register a logical type.
      Parameters:
        `factory` - The logical type factory
      Throws:
        `NullPointerException` - if `factory` or `factory.getTypedName()` is `null`

    - #### register

          public static void register(String logicalTypeName,
                                      LogicalTypes.LogicalTypeFactory factory)

      Register a logical type.
      Parameters:
        `logicalTypeName` - The logical type name
        `factory` - The logical type factory
      Throws:
        `NullPointerException` - if `logicalTypeName` or `factory` is `null`

    - #### getCustomRegisteredTypes

          public static Map<String,LogicalTypes.LogicalTypeFactory> getCustomRegisteredTypes()

      Return an unmodifiable map of any registered custom `LogicalType`

    - #### fromSchema

          public static LogicalType fromSchema(Schema schema)

      Returns the `LogicalType` from the schema, if one is present.

    - #### fromSchemaIgnoreInvalid

          public static LogicalType fromSchemaIgnoreInvalid(Schema schema)

    - #### decimal

          public static LogicalTypes.Decimal decimal(int precision)

      Create a Decimal LogicalType with the given precision and scale 0

    - #### decimal

          public static LogicalTypes.Decimal decimal(int precision,
                                                     int scale)

      Create a Decimal LogicalType with the given precision and scale

    - #### bigDecimal

          public static LogicalTypes.BigDecimal bigDecimal()

      Create a Big Decimal LogicalType that can accept any precision and scale

    - #### uuid

          public static LogicalType uuid()

    - #### date

          public static LogicalTypes.Date date()

    - #### timeMillis

          public static LogicalTypes.TimeMillis timeMillis()

    - #### timeMicros

          public static LogicalTypes.TimeMicros timeMicros()

    - #### timestampMillis

          public static LogicalTypes.TimestampMillis timestampMillis()

    - #### timestampMicros

          public static LogicalTypes.TimestampMicros timestampMicros()

    - #### localTimestampMillis

          public static LogicalTypes.LocalTimestampMillis localTimestampMillis()

    - #### localTimestampMicros

          public static LogicalTypes.LocalTimestampMicros localTimestampMicros()

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