// 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 FriendApplyListInfoOuterClass {
  /**
   * Protobuf type {@code FriendApplyListInfo}
   */
  public static final class FriendApplyListInfo extends ProtoMessage<FriendApplyListInfo> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional int64 JKBMJGNPCNN = 12;</code>
     */
    private long jKBMJGNPCNN;

    /**
     * <code>optional .SimpleInfo simple_info = 10;</code>
     */
    private final SimpleInfoOuterClass.SimpleInfo simpleInfo = SimpleInfoOuterClass.SimpleInfo.newInstance();

    private FriendApplyListInfo() {
    }

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

    /**
     * <code>optional int64 JKBMJGNPCNN = 12;</code>
     * @return whether the jKBMJGNPCNN field is set
     */
    public boolean hasJKBMJGNPCNN() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional int64 JKBMJGNPCNN = 12;</code>
     * @return this
     */
    public FriendApplyListInfo clearJKBMJGNPCNN() {
      bitField0_ &= ~0x00000001;
      jKBMJGNPCNN = 0L;
      return this;
    }

    /**
     * <code>optional int64 JKBMJGNPCNN = 12;</code>
     * @return the jKBMJGNPCNN
     */
    public long getJKBMJGNPCNN() {
      return jKBMJGNPCNN;
    }

    /**
     * <code>optional int64 JKBMJGNPCNN = 12;</code>
     * @param value the jKBMJGNPCNN to set
     * @return this
     */
    public FriendApplyListInfo setJKBMJGNPCNN(final long value) {
      bitField0_ |= 0x00000001;
      jKBMJGNPCNN = value;
      return this;
    }

    /**
     * <code>optional .SimpleInfo simple_info = 10;</code>
     * @return whether the simpleInfo field is set
     */
    public boolean hasSimpleInfo() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .SimpleInfo simple_info = 10;</code>
     * @return this
     */
    public FriendApplyListInfo clearSimpleInfo() {
      bitField0_ &= ~0x00000002;
      simpleInfo.clear();
      return this;
    }

    /**
     * <code>optional .SimpleInfo simple_info = 10;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableSimpleInfo()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public SimpleInfoOuterClass.SimpleInfo getSimpleInfo() {
      return simpleInfo;
    }

    /**
     * <code>optional .SimpleInfo simple_info = 10;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public SimpleInfoOuterClass.SimpleInfo getMutableSimpleInfo() {
      bitField0_ |= 0x00000002;
      return simpleInfo;
    }

    /**
     * <code>optional .SimpleInfo simple_info = 10;</code>
     * @param value the simpleInfo to set
     * @return this
     */
    public FriendApplyListInfo setSimpleInfo(final SimpleInfoOuterClass.SimpleInfo value) {
      bitField0_ |= 0x00000002;
      simpleInfo.copyFrom(value);
      return this;
    }

    @Override
    public FriendApplyListInfo copyFrom(final FriendApplyListInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        jKBMJGNPCNN = other.jKBMJGNPCNN;
        simpleInfo.copyFrom(other.simpleInfo);
      }
      return this;
    }

    @Override
    public FriendApplyListInfo mergeFrom(final FriendApplyListInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasJKBMJGNPCNN()) {
        setJKBMJGNPCNN(other.jKBMJGNPCNN);
      }
      if (other.hasSimpleInfo()) {
        getMutableSimpleInfo().mergeFrom(other.simpleInfo);
      }
      return this;
    }

    @Override
    public FriendApplyListInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      jKBMJGNPCNN = 0L;
      simpleInfo.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof FriendApplyListInfo)) {
        return false;
      }
      FriendApplyListInfo other = (FriendApplyListInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasJKBMJGNPCNN() || jKBMJGNPCNN == other.jKBMJGNPCNN)
        && (!hasSimpleInfo() || simpleInfo.equals(other.simpleInfo));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 96);
        output.writeInt64NoTag(jKBMJGNPCNN);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 82);
        output.writeMessageNoTag(simpleInfo);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(jKBMJGNPCNN);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(simpleInfo);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public FriendApplyListInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 96: {
            // jKBMJGNPCNN
            jKBMJGNPCNN = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 82) {
              break;
            }
          }
          case 82: {
            // simpleInfo
            input.readMessage(simpleInfo);
            bitField0_ |= 0x00000002;
            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.writeInt64(FieldNames.jKBMJGNPCNN, jKBMJGNPCNN);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeMessage(FieldNames.simpleInfo, simpleInfo);
      }
      output.endObject();
    }

    @Override
    public FriendApplyListInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -601575848: {
            if (input.isAtField(FieldNames.jKBMJGNPCNN)) {
              if (!input.trySkipNullValue()) {
                jKBMJGNPCNN = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1431903872:
          case -1419171045: {
            if (input.isAtField(FieldNames.simpleInfo)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(simpleInfo);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum FriendApplyListInfoFactory implements MessageFactory<FriendApplyListInfo> {
      INSTANCE;

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

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

      static final FieldName simpleInfo = FieldName.forField("simpleInfo", "simple_info");
    }
  }
}
