# Package org.apache.avro

Avro kernel classes.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  LogicalTypes.LogicalTypeFactory | Factory interface and SPI for logical types.
  SchemaValidationStrategy | An interface for validating the compatibility of a single schema against another.
  SchemaValidator | A SchemaValidator has one method, which validates that a `Schema` is compatible with the other schemas provided.

- Class Summary
  Class | Description
  --- | ---
  Conversion<T> | Conversion between generic and logical type instances.
  Conversions |
  Conversions.BigDecimalConversion |
  Conversions.DecimalConversion |
  Conversions.UUIDConversion |
  JsonProperties | Base class for objects that have JSON-valued properties.
  JsonProperties.Null |
  LogicalType | Logical types provides an opt-in way to extend Avro's types.
  LogicalTypes |
  LogicalTypes.BigDecimal |
  LogicalTypes.Date | Date represents a date without a time
  LogicalTypes.Decimal | Decimal represents arbitrary-precision fixed-scale decimal numbers
  LogicalTypes.LocalTimestampMicros |
  LogicalTypes.LocalTimestampMillis |
  LogicalTypes.TimeMicros | TimeMicros represents a time in microseconds without a date
  LogicalTypes.TimeMillis | TimeMillis represents a time in milliseconds without a date
  LogicalTypes.TimestampMicros | TimestampMicros represents a date and time in microseconds
  LogicalTypes.TimestampMillis | TimestampMillis represents a date and time in milliseconds
  Protocol | A set of messages forming an application protocol.
  Resolver | Encapsulate schema-resolution logic in an easy-to-consume representation.
  Resolver.Action | An abstract class for an action to be taken to resolve a writer's schema (found in public instance variable `writer`) against a reader's schema (in `reader`).
  Resolver.Container | Used for array and map schemas: the public instance variable `elementAction` contains the resolving action needed for the element type of an array or value top of a map.
  Resolver.DoNothing | In this case, there's nothing to be done for resolution: the two schemas are effectively the same.
  Resolver.EnumAdjust | Contains information needed to resolve enumerations.
  Resolver.ErrorAction | In this case there is an error.
  Resolver.Promote | In this case, the writer's type needs to be promoted to the reader's.
  Resolver.ReaderUnion | In this case, the reader is a union and the writer is not.
  Resolver.RecordAdjust | Instructions for resolving two record schemas.
  Resolver.Skip | This only appears inside `Resolver.RecordAdjust.fieldActions`, i.e., the actions for adjusting the fields of a record.
  Resolver.WriterUnion | In this case, the writer was a union.
  Schema | An abstract data type.
  Schema.Field | A field within a record.
  Schema.Parser | A parser for JSON-format schemas.
  Schema.SeenPair | Useful as key of `Map`s when traversing two schemas at the same time and need to watch for recursion.
  SchemaBuilder | A fluent interface for building `Schema` instances.
  SchemaBuilder.ArrayBuilder<R> | Builds an Avro Array type with optional properties.
  SchemaBuilder.ArrayDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.BaseFieldTypeBuilder<R> | A special Builder for Record fields.
  SchemaBuilder.BaseTypeBuilder<R> | A common API for building types within a context.
  SchemaBuilder.BooleanBuilder<R> | Builds an Avro boolean type with optional properties.
  SchemaBuilder.BooleanDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.BytesBuilder<R> | Builds an Avro bytes type with optional properties.
  SchemaBuilder.BytesDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.DoubleBuilder<R> | Builds an Avro double type with optional properties.
  SchemaBuilder.DoubleDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.EnumBuilder<R> | Builds an Avro Enum type with optional properties, namespace, doc, and aliases.
  SchemaBuilder.EnumDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.FieldAssembler<R> |
  SchemaBuilder.FieldBuilder<R> | Builds a Field in the context of a `SchemaBuilder.FieldAssembler`.
  SchemaBuilder.FieldDefault<R,S extends SchemaBuilder.FieldDefault<R,S>> | Abstract base class for field defaults.
  SchemaBuilder.FieldTypeBuilder<R> | FieldTypeBuilder adds `SchemaBuilder.FieldTypeBuilder.unionOf()`, `SchemaBuilder.FieldTypeBuilder.nullable()`, and `SchemaBuilder.FieldTypeBuilder.optional()` to BaseFieldTypeBuilder.
  SchemaBuilder.FixedBuilder<R> | Builds an Avro Fixed type with optional properties, namespace, doc, and aliases.
  SchemaBuilder.FixedDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.FloatBuilder<R> | Builds an Avro float type with optional properties.
  SchemaBuilder.FloatDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.GenericDefault<R> |
  SchemaBuilder.IntBuilder<R> | Builds an Avro int type with optional properties.
  SchemaBuilder.IntDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.LongBuilder<R> | Builds an Avro long type with optional properties.
  SchemaBuilder.LongDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.MapBuilder<R> | Builds an Avro Map type with optional properties.
  SchemaBuilder.MapDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.NamedBuilder<S extends SchemaBuilder.NamedBuilder<S>> | An abstract type that provides builder methods for configuring the name, doc, and aliases of all Avro types that have names (fields, Fixed, Record, and Enum).
  SchemaBuilder.NamespacedBuilder<R,S extends SchemaBuilder.NamespacedBuilder<R,S>> | An abstract type that provides builder methods for configuring the namespace for all Avro types that have namespaces (Fixed, Record, and Enum).
  SchemaBuilder.NullBuilder<R> | Builds an Avro null type with optional properties.
  SchemaBuilder.NullDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.PropBuilder<S extends SchemaBuilder.PropBuilder<S>> | An abstract builder for all Avro types.
  SchemaBuilder.RecordBuilder<R> |
  SchemaBuilder.RecordDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.StringBldr<R> | Builds an Avro string type with optional properties.
  SchemaBuilder.StringDefault<R> | Choose whether to use a default value for the field or not.
  SchemaBuilder.TypeBuilder<R> | A Builder for creating any Avro schema type.
  SchemaBuilder.UnionAccumulator<R> | Accumulates all of the types in a union.
  SchemaBuilder.UnionFieldTypeBuilder<R> | Builder for a union field.
  SchemaCompatibility | Evaluate the compatibility between a reader schema and a writer schema.
  SchemaCompatibility.Incompatibility |
  SchemaCompatibility.SchemaCompatibilityResult | Immutable class representing details about a particular schema pair compatibility check.
  SchemaCompatibility.SchemaPairCompatibility | Provides information about the compatibility of a single reader and writer schema pair.
  SchemaNormalization | Collection of static methods for generating the canonical form of schemas (see `SchemaNormalization.toParsingForm(org.apache.avro.Schema)`) -- and fingerprints of canonical forms (`SchemaNormalization.fingerprint(java.lang.String, byte[])`).
  SchemaValidatorBuilder | A Builder for creating SchemaValidators.
  ValidateAll | A `SchemaValidator` for validating the provided schema against all schemas in the Iterable in `ValidateAll.validate(Schema, Iterable)`.
  ValidateLatest | A `SchemaValidator` for validating the provided schema against the first `Schema` in the iterable in `ValidateLatest.validate(Schema, Iterable)`.

- Enum Summary
  Enum | Description
  --- | ---
  Resolver.Action.Type | Helps us traverse faster.
  Resolver.ErrorAction.ErrorType |
  Schema.Field.Order | How values of this field should be ordered when sorting records.
  Schema.Type | The type of a schema.
  SchemaCompatibility.SchemaCompatibilityType | Identifies the type of a schema compatibility result.
  SchemaCompatibility.SchemaIncompatibilityType |

- Exception Summary
  Exception | Description
  --- | ---
  AvroMissingFieldException | Avro exception in case of missing fields.
  AvroRemoteException | Base class for exceptions thrown to client by server.
  AvroRuntimeException | Base Avro exception.
  AvroTypeException | Thrown when an illegal type is used.
  InvalidAvroMagicException |
  InvalidNumberEncodingException |
  SchemaBuilderException | Thrown for errors building schemas.
  SchemaParseException | Thrown for errors parsing schemas and protocols.
  SchemaValidationException | Thrown when `SchemaValidator` fails to validate a schema.
  SystemLimitException | Thrown to prevent making large allocations when reading potentially pathological input data from an untrusted source.
  UnknownAvroCodecException |
  UnresolvedUnionException | Thrown when the expected contents of a union cannot be resolved.

## Package org.apache.avro Description

Avro kernel classes.

A `Schema` provides an abstract definition of a data type.

The in-memory representation of data is determined by `DatumReader` and `DatumWriter` implementations. Generic implementations are provided in the `org.apache.avro.generic` package. A `compiler` can generate specific java classes and interfaces for schemas and protocols. Schemas may be automatically generated for existing Java classes by reflection using the `org.apache.avro.reflect` package.

Data of a given schema is always serialized identically, regardless of its in-memory representation, by traversing the schema and writing leaf values from the data structure with a `Encoder`. Deserializing similarly proceeds by traversing the schema, reading leaf values with a `Decoder` and storing them in an in-memory data structure.

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