org.apache.avro

## Class SchemaCompatibility.SchemaCompatibilityResult

- java.lang.Object
- - org.apache.avro.SchemaCompatibility.SchemaCompatibilityResult

Enclosing class:
  SchemaCompatibility

    public static final class SchemaCompatibility.SchemaCompatibilityResult
    extends Object

Immutable class representing details about a particular schema pair compatibility check.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static SchemaCompatibility.SchemaCompatibilityResult` `compatible()` Returns a details object representing a compatible schema pair.
`boolean` `equals(Object obj)`
`SchemaCompatibility.SchemaCompatibilityType` `getCompatibility()` Returns the SchemaCompatibilityType, always non-null.
`List<SchemaCompatibility.Incompatibility>` `getIncompatibilities()` If the compatibility is INCOMPATIBLE, returns `Incompatibilities` found, otherwise an empty list.
`int` `hashCode()`
`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.
`SchemaCompatibility.SchemaCompatibilityResult` `mergedWith(SchemaCompatibility.SchemaCompatibilityResult toMerge)` Merges the current `SchemaCompatibilityResult` with the supplied result into a new instance, combining the list of `Incompatibility Incompatibilities` and regressing to the `SchemaCompatibilityType#INCOMPATIBLE INCOMPATIBLE` state if any incompatibilities are encountered.
`static SchemaCompatibility.SchemaCompatibilityResult` `recursionInProgress()` Returns a details object representing a state indicating that recursion is in progress.
`String` `toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### mergedWith

    public SchemaCompatibility.SchemaCompatibilityResult mergedWith(SchemaCompatibility.SchemaCompatibilityResult toMerge)

Merges the current `SchemaCompatibilityResult` with the supplied result into a new instance, combining the list of `Incompatibility Incompatibilities` and regressing to the `SchemaCompatibilityType#INCOMPATIBLE INCOMPATIBLE` state if any incompatibilities are encountered.

Parameters:
  `toMerge` - The `SchemaCompatibilityResult` to merge with the current instance.
Returns:
  A `SchemaCompatibilityResult` that combines the state of the current and supplied instances.

#### compatible

    public static SchemaCompatibility.SchemaCompatibilityResult compatible()

Returns a details object representing a compatible schema pair.

Returns:
  a SchemaCompatibilityDetails object with COMPATIBLE SchemaCompatibilityType, and no other state.

#### recursionInProgress

    public static SchemaCompatibility.SchemaCompatibilityResult 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

    public SchemaCompatibility.SchemaCompatibilityType getCompatibility()

Returns the SchemaCompatibilityType, always non-null.

Returns:
  a SchemaCompatibilityType instance, always non-null

#### getIncompatibilities

    public List<SchemaCompatibility.Incompatibility> getIncompatibilities()

If the compatibility is INCOMPATIBLE, returns `Incompatibilities` found, otherwise an empty list.

Returns:
  a list of `Incompatibilities`, may be empty, never null.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`