Package org.apache.avro
Class LogicalTypes
java.lang.Object
org.apache.avro.LogicalTypes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classDate represents a date without a timestatic classDecimal represents arbitrary-precision fixed-scale decimal numbersstatic classDuration represents a duration, consisting on months, days and millisecondsstatic classstatic classstatic classstatic interfaceFactory interface and SPI for logical types.static classTimeMicros represents a time in microseconds without a datestatic classTimeMillis represents a time in milliseconds without a datestatic classTimestampMicros represents a date and time in microsecondsstatic classTimestampMillis represents a date and time in millisecondsstatic classTimestampNanos represents a date and time in nanosecondsstatic classUuid represents a uuid without a time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LogicalTypes.BigDecimalCreate a Big Decimal LogicalType that can accept any precision and scalestatic LogicalTypes.Datedate()static LogicalTypes.Decimaldecimal(int precision) Create a Decimal LogicalType with the given precision and scale 0static LogicalTypes.Decimaldecimal(int precision, int scale) Create a Decimal LogicalType with the given precision and scalestatic LogicalTypeduration()static LogicalTypefromSchema(Schema schema) Returns theLogicalTypefrom the schema, if one is present.static LogicalTypefromSchemaIgnoreInvalid(Schema schema) static Map<String, LogicalTypes.LogicalTypeFactory> Return an unmodifiable map of any registered customLogicalTypestatic voidregister(String logicalTypeName, LogicalTypes.LogicalTypeFactory factory) Register a logical type.static voidregister(LogicalTypes.LogicalTypeFactory factory) Register a logical type.static LogicalTypes.TimeMicrosstatic LogicalTypes.TimeMillisstatic LogicalTypes.TimestampMicrosstatic LogicalTypes.TimestampMillisstatic LogicalTypes.TimestampNanosstatic LogicalTypeuuid()
-
Constructor Details
-
LogicalTypes
public LogicalTypes()
-
-
Method Details
-
register
Register a logical type.- Parameters:
factory- The logical type factory- Throws:
NullPointerException- iffactoryorfactory.getTypedName()isnull
-
register
Register a logical type.- Parameters:
logicalTypeName- The logical type namefactory- The logical type factory- Throws:
NullPointerException- iflogicalTypeNameorfactoryisnull
-
getCustomRegisteredTypes
Return an unmodifiable map of any registered customLogicalType -
fromSchema
Returns theLogicalTypefrom the schema, if one is present. -
fromSchemaIgnoreInvalid
-
decimal
Create a Decimal LogicalType with the given precision and scale 0 -
decimal
Create a Decimal LogicalType with the given precision and scale -
bigDecimal
Create a Big Decimal LogicalType that can accept any precision and scale -
uuid
-
duration
-
date
-
timeMillis
-
timeMicros
-
timestampMillis
-
timestampMicros
-
timestampNanos
-
localTimestampMillis
-
localTimestampMicros
-
localTimestampNanos
-