code: private Object getEnumValue(EnumValueDescriptor enumDesc) {
      if (enumSerialization == EnumSerialization.NAME) {
        return getCustSerializedEnumValue(enumDesc.getOptions(), enumDesc.getName());
      } else {
        return enumDesc.getNumber();
      }
    }
docs: Returns the enum value to use for serialization, depending on the value of
  {@link EnumSerialization} that was given to this adapter.