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

    /**
     * <code>optional uint32 rogue_ability_point = 7;</code>
     */
    private int rogueAbilityPoint;

    /**
     * <code>optional uint32 rogue_puman_coupon = 8;</code>
     */
    private int roguePumanCoupon;

    /**
     * <code>optional uint32 rogue_coin = 10;</code>
     */
    private int rogueCoin;

    /**
     * <code>optional uint32 rogue_immersifier = 13;</code>
     */
    private int rogueImmersifier;

    private RogueVirtualItemInfo() {
    }

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

    /**
     * <code>optional uint32 rogue_ability_point = 7;</code>
     * @return whether the rogueAbilityPoint field is set
     */
    public boolean hasRogueAbilityPoint() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 rogue_ability_point = 7;</code>
     * @return this
     */
    public RogueVirtualItemInfo clearRogueAbilityPoint() {
      bitField0_ &= ~0x00000001;
      rogueAbilityPoint = 0;
      return this;
    }

    /**
     * <code>optional uint32 rogue_ability_point = 7;</code>
     * @return the rogueAbilityPoint
     */
    public int getRogueAbilityPoint() {
      return rogueAbilityPoint;
    }

    /**
     * <code>optional uint32 rogue_ability_point = 7;</code>
     * @param value the rogueAbilityPoint to set
     * @return this
     */
    public RogueVirtualItemInfo setRogueAbilityPoint(final int value) {
      bitField0_ |= 0x00000001;
      rogueAbilityPoint = value;
      return this;
    }

    /**
     * <code>optional uint32 rogue_puman_coupon = 8;</code>
     * @return whether the roguePumanCoupon field is set
     */
    public boolean hasRoguePumanCoupon() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 rogue_puman_coupon = 8;</code>
     * @return this
     */
    public RogueVirtualItemInfo clearRoguePumanCoupon() {
      bitField0_ &= ~0x00000002;
      roguePumanCoupon = 0;
      return this;
    }

    /**
     * <code>optional uint32 rogue_puman_coupon = 8;</code>
     * @return the roguePumanCoupon
     */
    public int getRoguePumanCoupon() {
      return roguePumanCoupon;
    }

    /**
     * <code>optional uint32 rogue_puman_coupon = 8;</code>
     * @param value the roguePumanCoupon to set
     * @return this
     */
    public RogueVirtualItemInfo setRoguePumanCoupon(final int value) {
      bitField0_ |= 0x00000002;
      roguePumanCoupon = value;
      return this;
    }

    /**
     * <code>optional uint32 rogue_coin = 10;</code>
     * @return whether the rogueCoin field is set
     */
    public boolean hasRogueCoin() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional uint32 rogue_coin = 10;</code>
     * @return this
     */
    public RogueVirtualItemInfo clearRogueCoin() {
      bitField0_ &= ~0x00000004;
      rogueCoin = 0;
      return this;
    }

    /**
     * <code>optional uint32 rogue_coin = 10;</code>
     * @return the rogueCoin
     */
    public int getRogueCoin() {
      return rogueCoin;
    }

    /**
     * <code>optional uint32 rogue_coin = 10;</code>
     * @param value the rogueCoin to set
     * @return this
     */
    public RogueVirtualItemInfo setRogueCoin(final int value) {
      bitField0_ |= 0x00000004;
      rogueCoin = value;
      return this;
    }

    /**
     * <code>optional uint32 rogue_immersifier = 13;</code>
     * @return whether the rogueImmersifier field is set
     */
    public boolean hasRogueImmersifier() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional uint32 rogue_immersifier = 13;</code>
     * @return this
     */
    public RogueVirtualItemInfo clearRogueImmersifier() {
      bitField0_ &= ~0x00000008;
      rogueImmersifier = 0;
      return this;
    }

    /**
     * <code>optional uint32 rogue_immersifier = 13;</code>
     * @return the rogueImmersifier
     */
    public int getRogueImmersifier() {
      return rogueImmersifier;
    }

    /**
     * <code>optional uint32 rogue_immersifier = 13;</code>
     * @param value the rogueImmersifier to set
     * @return this
     */
    public RogueVirtualItemInfo setRogueImmersifier(final int value) {
      bitField0_ |= 0x00000008;
      rogueImmersifier = value;
      return this;
    }

    @Override
    public RogueVirtualItemInfo copyFrom(final RogueVirtualItemInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        rogueAbilityPoint = other.rogueAbilityPoint;
        roguePumanCoupon = other.roguePumanCoupon;
        rogueCoin = other.rogueCoin;
        rogueImmersifier = other.rogueImmersifier;
      }
      return this;
    }

    @Override
    public RogueVirtualItemInfo mergeFrom(final RogueVirtualItemInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasRogueAbilityPoint()) {
        setRogueAbilityPoint(other.rogueAbilityPoint);
      }
      if (other.hasRoguePumanCoupon()) {
        setRoguePumanCoupon(other.roguePumanCoupon);
      }
      if (other.hasRogueCoin()) {
        setRogueCoin(other.rogueCoin);
      }
      if (other.hasRogueImmersifier()) {
        setRogueImmersifier(other.rogueImmersifier);
      }
      return this;
    }

    @Override
    public RogueVirtualItemInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      rogueAbilityPoint = 0;
      roguePumanCoupon = 0;
      rogueCoin = 0;
      rogueImmersifier = 0;
      return this;
    }

    @Override
    public RogueVirtualItemInfo 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 RogueVirtualItemInfo)) {
        return false;
      }
      RogueVirtualItemInfo other = (RogueVirtualItemInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasRogueAbilityPoint() || rogueAbilityPoint == other.rogueAbilityPoint)
        && (!hasRoguePumanCoupon() || roguePumanCoupon == other.roguePumanCoupon)
        && (!hasRogueCoin() || rogueCoin == other.rogueCoin)
        && (!hasRogueImmersifier() || rogueImmersifier == other.rogueImmersifier);
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 56);
        output.writeUInt32NoTag(rogueAbilityPoint);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 64);
        output.writeUInt32NoTag(roguePumanCoupon);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 80);
        output.writeUInt32NoTag(rogueCoin);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 104);
        output.writeUInt32NoTag(rogueImmersifier);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(rogueAbilityPoint);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(roguePumanCoupon);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(rogueCoin);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(rogueImmersifier);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public RogueVirtualItemInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 56: {
            // rogueAbilityPoint
            rogueAbilityPoint = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 64) {
              break;
            }
          }
          case 64: {
            // roguePumanCoupon
            roguePumanCoupon = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 80) {
              break;
            }
          }
          case 80: {
            // rogueCoin
            rogueCoin = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 104) {
              break;
            }
          }
          case 104: {
            // rogueImmersifier
            rogueImmersifier = input.readUInt32();
            bitField0_ |= 0x00000008;
            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.writeUInt32(FieldNames.rogueAbilityPoint, rogueAbilityPoint);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.roguePumanCoupon, roguePumanCoupon);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.rogueCoin, rogueCoin);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.rogueImmersifier, rogueImmersifier);
      }
      output.endObject();
    }

    @Override
    public RogueVirtualItemInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 1319384448:
          case -1613205354: {
            if (input.isAtField(FieldNames.rogueAbilityPoint)) {
              if (!input.trySkipNullValue()) {
                rogueAbilityPoint = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 845104001:
          case -2086985547: {
            if (input.isAtField(FieldNames.roguePumanCoupon)) {
              if (!input.trySkipNullValue()) {
                roguePumanCoupon = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 655631243:
          case -1124761130: {
            if (input.isAtField(FieldNames.rogueCoin)) {
              if (!input.trySkipNullValue()) {
                rogueCoin = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1115528066:
          case -1695636777: {
            if (input.isAtField(FieldNames.rogueImmersifier)) {
              if (!input.trySkipNullValue()) {
                rogueImmersifier = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum RogueVirtualItemInfoFactory implements MessageFactory<RogueVirtualItemInfo> {
      INSTANCE;

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

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

      static final FieldName roguePumanCoupon = FieldName.forField("roguePumanCoupon", "rogue_puman_coupon");

      static final FieldName rogueCoin = FieldName.forField("rogueCoin", "rogue_coin");

      static final FieldName rogueImmersifier = FieldName.forField("rogueImmersifier", "rogue_immersifier");
    }
  }
}
