Package org.apache.avro
Class SchemaCompatibility.SchemaCompatibilityResult
java.lang.Object
org.apache.avro.SchemaCompatibility.SchemaCompatibilityResult
- Enclosing class:
SchemaCompatibility
Immutable class representing details about a particular schema pair
compatibility check.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a details object representing a compatible schema pair.boolean
Returns the SchemaCompatibilityType, always non-null.If the compatibility is INCOMPATIBLE, returnsIncompatibilities
found, otherwise an empty list.int
hashCode()
incompatible
(SchemaCompatibility.SchemaIncompatibilityType incompatibilityType, Schema readerFragment, Schema writerFragment, String message, List<String> location) Returns a details object representing an incompatible schema pair, including error details.Merges the currentSchemaCompatibilityResult
with the supplied result into a new instance, combining the list ofIncompatibility Incompatibilities
and regressing to theSchemaCompatibilityType#INCOMPATIBLE INCOMPATIBLE
state if any incompatibilities are encountered.Returns a details object representing a state indicating that recursion is in progress.toString()
-
Method Details
-
mergedWith
public SchemaCompatibility.SchemaCompatibilityResult mergedWith(SchemaCompatibility.SchemaCompatibilityResult toMerge) Merges the currentSchemaCompatibilityResult
with the supplied result into a new instance, combining the list ofIncompatibility Incompatibilities
and regressing to theSchemaCompatibilityType#INCOMPATIBLE INCOMPATIBLE
state if any incompatibilities are encountered.- Parameters:
toMerge
- TheSchemaCompatibilityResult
to merge with the current instance.- Returns:
- A
SchemaCompatibilityResult
that combines the state of the current and supplied instances.
-
compatible
Returns a details object representing a compatible schema pair.- Returns:
- a SchemaCompatibilityDetails object with COMPATIBLE SchemaCompatibilityType, and no other state.
-
recursionInProgress
Returns a details object representing a state indicating that recursion is in progress.- Returns:
- a SchemaCompatibilityDetails object with RECURSION_IN_PROGRESS SchemaCompatibilityType, and no other state.
-
incompatible
public static SchemaCompatibility.SchemaCompatibilityResult incompatible(SchemaCompatibility.SchemaIncompatibilityType incompatibilityType, Schema readerFragment, Schema writerFragment, String message, List<String> location) Returns a details object representing an incompatible schema pair, including error details.- Returns:
- a SchemaCompatibilityDetails object with INCOMPATIBLE SchemaCompatibilityType, and state representing the violating part.
-
getCompatibility
Returns the SchemaCompatibilityType, always non-null.- Returns:
- a SchemaCompatibilityType instance, always non-null
-
getIncompatibilities
If the compatibility is INCOMPATIBLE, returnsIncompatibilities
found, otherwise an empty list.- Returns:
- a list of
Incompatibilities
, may be empty, never null.
-
hashCode
public int hashCode() -
equals
-
toString
-