Class Resolver.EnumAdjust

java.lang.Object
org.apache.avro.Resolver.Action
org.apache.avro.Resolver.EnumAdjust
Enclosing class:
Resolver

public static class Resolver.EnumAdjust extends Resolver.Action
Contains information needed to resolve enumerations. When resolving enums, adjustments need to be made in two scenarios: the index for an enum symbol might be different in the reader or writer, or the reader might not have a symbol that was written out for the writer (which is an error, but one we can only detect when decoding data). These adjustments are reflected in the instance variable adjustments. For the symbol with index i in the writer's enum definition, adjustments[i] -- and integer -- contains the adjustment for that symbol. If the integer is positive, then reader also has the symbol and the integer is its index in the reader's schema. If adjustment[i] is negative, then the reader does not have the corresponding symbol (which is the error case). Sometimes there's no adjustments needed: all symbols in the reader have the same index in the reader's and writer's schema. This is a common case, and it allows for some optimization. To signal that this is the case, noAdjustmentsNeeded is set to true.