Package 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
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.Duration`
Duration represents a duration, consisting on months, days and milliseconds
`static class`
`LogicalTypes.LocalTimestampMicros`
`static class`
`LogicalTypes.LocalTimestampMillis`
`static class`
`LogicalTypes.LocalTimestampNanos`
`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
`static class`
`LogicalTypes.TimestampNanos`
TimestampNanos represents a date and time in nanoseconds
`static class`
`LogicalTypes.Uuid`
Uuid represents a uuid without a time

## Constructor Summary

Constructors
Constructor
Description
`LogicalTypes()`

## Method Summary

Modifier and Type
Method
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`
`duration()`
`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 LogicalTypes.LocalTimestampNanos`
`localTimestampNanos()`
`static void`
`register(String logicalTypeName, LogicalTypes.LogicalTypeFactory factory)`
Register a logical type.
`static void`
`register(LogicalTypes.LogicalTypeFactory factory)`
Register a logical type.
`static LogicalTypes.TimeMicros`
`timeMicros()`
`static LogicalTypes.TimeMillis`
`timeMillis()`
`static LogicalTypes.TimestampMicros`
`timestampMicros()`
`static LogicalTypes.TimestampMillis`
`timestampMillis()`
`static LogicalTypes.TimestampNanos`
`timestampNanos()`
`static LogicalType`
`uuid()`

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

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

## Constructor Details

### LogicalTypes

public LogicalTypes()

## Method Details

### 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()

### duration

public static LogicalType duration()

### 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()

### timestampNanos

public static LogicalTypes.TimestampNanos timestampNanos()

### localTimestampMillis

public static LogicalTypes.LocalTimestampMillis localTimestampMillis()

### localTimestampMicros

public static LogicalTypes.LocalTimestampMicros localTimestampMicros()

### localTimestampNanos

public static LogicalTypes.LocalTimestampNanos localTimestampNanos()