Top Description Fields Constructors Methods
org.apache.avro

public final Class ValidateLatest

extends Object
implements SchemaValidator
Class Inheritance
All Implemented Interfaces
org.apache.avro.SchemaValidator
Imports
java.util.Iterator

A SchemaValidator for validating the provided schema against the first Schema in the iterable in validate(Schema, Iterable).

Uses the SchemaValidationStrategy provided in the constructor to validate the schema against the first Schema in the iterable, if it exists, via SchemaValidationStrategy#validate(Schema, Schema).

Field Summary

Modifier and TypeField and Description
private final SchemaValidationStrategy

Constructor Summary

AccessConstructor and Description
public
ValidateLatest(SchemaValidationStrategy
The strategy to use for validation of pairwise schemas.
strategy
)

Method Summary

Modifier and TypeMethod and Description
public void
validate(Schema
The schema to validate
toValidate
,
Iterable<Schema>
The schemas to validate against, in order from most recent to latest if applicable
schemasInOrder
)

Implements org.apache.avro.SchemaValidator.validate.

Validate one schema against others.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

strategyback to summary
private final SchemaValidationStrategy strategy

Constructor Detail

ValidateLatestback to summary
public ValidateLatest(SchemaValidationStrategy strategy)
Parameters
strategy:SchemaValidationStrategy

The strategy to use for validation of pairwise schemas.

Method Detail

validateback to summary
public void validate(Schema toValidate, Iterable<Schema> schemasInOrder) throws SchemaValidationException

Implements org.apache.avro.SchemaValidator.validate.

Doc from org.apache.avro.SchemaValidator.validate.

Validate one schema against others. The order of the schemas to validate against is chronological from most recent to oldest, if there is a natural chronological order. This allows some validators to identify which schemas are the most "recent" in order to validate only against the most recent schema(s).

Parameters
toValidate:Schema

The schema to validate

schemasInOrder:Iterable<Schema>

The schemas to validate against, in order from most recent to latest if applicable

Annotations
@Override
Exceptions
SchemaValidationException:
if the schema fails to validate.