// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;

import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;

public final class PlayerSettingInfoOuterClass {
  /**
   * Protobuf type {@code PlayerSettingInfo}
   */
  public static final class PlayerSettingInfo extends ProtoMessage<PlayerSettingInfo> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional bool OFOCDABPBEN = 6;</code>
     */
    private boolean oFOCDABPBEN;

    /**
     * <code>optional bool FFIJPBKIGPJ = 11;</code>
     */
    private boolean fFIJPBKIGPJ;

    /**
     * <code>optional bool MDJEPNGEHFN = 14;</code>
     */
    private boolean mDJEPNGEHFN;

    private PlayerSettingInfo() {
    }

    /**
     * @return a new empty instance of {@code PlayerSettingInfo}
     */
    public static PlayerSettingInfo newInstance() {
      return new PlayerSettingInfo();
    }

    /**
     * <code>optional bool OFOCDABPBEN = 6;</code>
     * @return whether the oFOCDABPBEN field is set
     */
    public boolean hasOFOCDABPBEN() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional bool OFOCDABPBEN = 6;</code>
     * @return this
     */
    public PlayerSettingInfo clearOFOCDABPBEN() {
      bitField0_ &= ~0x00000001;
      oFOCDABPBEN = false;
      return this;
    }

    /**
     * <code>optional bool OFOCDABPBEN = 6;</code>
     * @return the oFOCDABPBEN
     */
    public boolean getOFOCDABPBEN() {
      return oFOCDABPBEN;
    }

    /**
     * <code>optional bool OFOCDABPBEN = 6;</code>
     * @param value the oFOCDABPBEN to set
     * @return this
     */
    public PlayerSettingInfo setOFOCDABPBEN(final boolean value) {
      bitField0_ |= 0x00000001;
      oFOCDABPBEN = value;
      return this;
    }

    /**
     * <code>optional bool FFIJPBKIGPJ = 11;</code>
     * @return whether the fFIJPBKIGPJ field is set
     */
    public boolean hasFFIJPBKIGPJ() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional bool FFIJPBKIGPJ = 11;</code>
     * @return this
     */
    public PlayerSettingInfo clearFFIJPBKIGPJ() {
      bitField0_ &= ~0x00000002;
      fFIJPBKIGPJ = false;
      return this;
    }

    /**
     * <code>optional bool FFIJPBKIGPJ = 11;</code>
     * @return the fFIJPBKIGPJ
     */
    public boolean getFFIJPBKIGPJ() {
      return fFIJPBKIGPJ;
    }

    /**
     * <code>optional bool FFIJPBKIGPJ = 11;</code>
     * @param value the fFIJPBKIGPJ to set
     * @return this
     */
    public PlayerSettingInfo setFFIJPBKIGPJ(final boolean value) {
      bitField0_ |= 0x00000002;
      fFIJPBKIGPJ = value;
      return this;
    }

    /**
     * <code>optional bool MDJEPNGEHFN = 14;</code>
     * @return whether the mDJEPNGEHFN field is set
     */
    public boolean hasMDJEPNGEHFN() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional bool MDJEPNGEHFN = 14;</code>
     * @return this
     */
    public PlayerSettingInfo clearMDJEPNGEHFN() {
      bitField0_ &= ~0x00000004;
      mDJEPNGEHFN = false;
      return this;
    }

    /**
     * <code>optional bool MDJEPNGEHFN = 14;</code>
     * @return the mDJEPNGEHFN
     */
    public boolean getMDJEPNGEHFN() {
      return mDJEPNGEHFN;
    }

    /**
     * <code>optional bool MDJEPNGEHFN = 14;</code>
     * @param value the mDJEPNGEHFN to set
     * @return this
     */
    public PlayerSettingInfo setMDJEPNGEHFN(final boolean value) {
      bitField0_ |= 0x00000004;
      mDJEPNGEHFN = value;
      return this;
    }

    @Override
    public PlayerSettingInfo copyFrom(final PlayerSettingInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        oFOCDABPBEN = other.oFOCDABPBEN;
        fFIJPBKIGPJ = other.fFIJPBKIGPJ;
        mDJEPNGEHFN = other.mDJEPNGEHFN;
      }
      return this;
    }

    @Override
    public PlayerSettingInfo mergeFrom(final PlayerSettingInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasOFOCDABPBEN()) {
        setOFOCDABPBEN(other.oFOCDABPBEN);
      }
      if (other.hasFFIJPBKIGPJ()) {
        setFFIJPBKIGPJ(other.fFIJPBKIGPJ);
      }
      if (other.hasMDJEPNGEHFN()) {
        setMDJEPNGEHFN(other.mDJEPNGEHFN);
      }
      return this;
    }

    @Override
    public PlayerSettingInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      oFOCDABPBEN = false;
      fFIJPBKIGPJ = false;
      mDJEPNGEHFN = false;
      return this;
    }

    @Override
    public PlayerSettingInfo clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof PlayerSettingInfo)) {
        return false;
      }
      PlayerSettingInfo other = (PlayerSettingInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasOFOCDABPBEN() || oFOCDABPBEN == other.oFOCDABPBEN)
        && (!hasFFIJPBKIGPJ() || fFIJPBKIGPJ == other.fFIJPBKIGPJ)
        && (!hasMDJEPNGEHFN() || mDJEPNGEHFN == other.mDJEPNGEHFN);
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 48);
        output.writeBoolNoTag(oFOCDABPBEN);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 88);
        output.writeBoolNoTag(fFIJPBKIGPJ);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 112);
        output.writeBoolNoTag(mDJEPNGEHFN);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 2;
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public PlayerSettingInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 48: {
            // oFOCDABPBEN
            oFOCDABPBEN = input.readBool();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 88) {
              break;
            }
          }
          case 88: {
            // fFIJPBKIGPJ
            fFIJPBKIGPJ = input.readBool();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // mDJEPNGEHFN
            mDJEPNGEHFN = input.readBool();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeBool(FieldNames.oFOCDABPBEN, oFOCDABPBEN);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeBool(FieldNames.fFIJPBKIGPJ, fFIJPBKIGPJ);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeBool(FieldNames.mDJEPNGEHFN, mDJEPNGEHFN);
      }
      output.endObject();
    }

    @Override
    public PlayerSettingInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 797917877: {
            if (input.isAtField(FieldNames.oFOCDABPBEN)) {
              if (!input.trySkipNullValue()) {
                oFOCDABPBEN = input.readBool();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -837946704: {
            if (input.isAtField(FieldNames.fFIJPBKIGPJ)) {
              if (!input.trySkipNullValue()) {
                fFIJPBKIGPJ = input.readBool();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1730511646: {
            if (input.isAtField(FieldNames.mDJEPNGEHFN)) {
              if (!input.trySkipNullValue()) {
                mDJEPNGEHFN = input.readBool();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

    @Override
    public PlayerSettingInfo clone() {
      return new PlayerSettingInfo().copyFrom(this);
    }

    @Override
    public boolean isEmpty() {
      return ((bitField0_) == 0);
    }

    public static PlayerSettingInfo parseFrom(final byte[] data) throws
        InvalidProtocolBufferException {
      return ProtoMessage.mergeFrom(new PlayerSettingInfo(), data).checkInitialized();
    }

    public static PlayerSettingInfo parseFrom(final ProtoSource input) throws IOException {
      return ProtoMessage.mergeFrom(new PlayerSettingInfo(), input).checkInitialized();
    }

    public static PlayerSettingInfo parseFrom(final JsonSource input) throws IOException {
      return ProtoMessage.mergeFrom(new PlayerSettingInfo(), input).checkInitialized();
    }

    /**
     * @return factory for creating PlayerSettingInfo messages
     */
    public static MessageFactory<PlayerSettingInfo> getFactory() {
      return PlayerSettingInfoFactory.INSTANCE;
    }

    private enum PlayerSettingInfoFactory implements MessageFactory<PlayerSettingInfo> {
      INSTANCE;

      @Override
      public PlayerSettingInfo create() {
        return PlayerSettingInfo.newInstance();
      }
    }

    /**
     * Contains name constants used for serializing JSON
     */
    static class FieldNames {
      static final FieldName oFOCDABPBEN = FieldName.forField("OFOCDABPBEN");

      static final FieldName fFIJPBKIGPJ = FieldName.forField("FFIJPBKIGPJ");

      static final FieldName mDJEPNGEHFN = FieldName.forField("MDJEPNGEHFN");
    }
  }
}
