// 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;
import us.hebi.quickbuf.RepeatedByte;

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

    /**
     * <code>optional bool KBFLIKKFOEG = 3;</code>
     */
    private boolean kBFLIKKFOEG;

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</code>
     */
    private final RepeatedByte cOOGIPJIPIA = RepeatedByte.newEmptyInstance();

    private PropTimelineInfo() {
    }

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

    /**
     * <code>optional bool KBFLIKKFOEG = 3;</code>
     * @return whether the kBFLIKKFOEG field is set
     */
    public boolean hasKBFLIKKFOEG() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional bool KBFLIKKFOEG = 3;</code>
     * @return this
     */
    public PropTimelineInfo clearKBFLIKKFOEG() {
      bitField0_ &= ~0x00000001;
      kBFLIKKFOEG = false;
      return this;
    }

    /**
     * <code>optional bool KBFLIKKFOEG = 3;</code>
     * @return the kBFLIKKFOEG
     */
    public boolean getKBFLIKKFOEG() {
      return kBFLIKKFOEG;
    }

    /**
     * <code>optional bool KBFLIKKFOEG = 3;</code>
     * @param value the kBFLIKKFOEG to set
     * @return this
     */
    public PropTimelineInfo setKBFLIKKFOEG(final boolean value) {
      bitField0_ |= 0x00000001;
      kBFLIKKFOEG = value;
      return this;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</code>
     * @return whether the cOOGIPJIPIA field is set
     */
    public boolean hasCOOGIPJIPIA() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</code>
     * @return this
     */
    public PropTimelineInfo clearCOOGIPJIPIA() {
      bitField0_ &= ~0x00000002;
      cOOGIPJIPIA.clear();
      return this;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</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 #getMutableCOOGIPJIPIA()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getCOOGIPJIPIA() {
      return cOOGIPJIPIA;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</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 RepeatedByte getMutableCOOGIPJIPIA() {
      bitField0_ |= 0x00000002;
      return cOOGIPJIPIA;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</code>
     * @param value the cOOGIPJIPIA to add
     * @return this
     */
    public PropTimelineInfo addCOOGIPJIPIA(final byte value) {
      bitField0_ |= 0x00000002;
      cOOGIPJIPIA.add(value);
      return this;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</code>
     * @param values the cOOGIPJIPIA to add
     * @return this
     */
    public PropTimelineInfo addAllCOOGIPJIPIA(final byte... values) {
      bitField0_ |= 0x00000002;
      cOOGIPJIPIA.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes COOGIPJIPIA = 12;</code>
     * @param values the cOOGIPJIPIA to set
     * @return this
     */
    public PropTimelineInfo setCOOGIPJIPIA(final byte... values) {
      bitField0_ |= 0x00000002;
      cOOGIPJIPIA.copyFrom(values);
      return this;
    }

    @Override
    public PropTimelineInfo copyFrom(final PropTimelineInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        kBFLIKKFOEG = other.kBFLIKKFOEG;
        cOOGIPJIPIA.copyFrom(other.cOOGIPJIPIA);
      }
      return this;
    }

    @Override
    public PropTimelineInfo mergeFrom(final PropTimelineInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasKBFLIKKFOEG()) {
        setKBFLIKKFOEG(other.kBFLIKKFOEG);
      }
      if (other.hasCOOGIPJIPIA()) {
        getMutableCOOGIPJIPIA().copyFrom(other.cOOGIPJIPIA);
      }
      return this;
    }

    @Override
    public PropTimelineInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      kBFLIKKFOEG = false;
      cOOGIPJIPIA.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof PropTimelineInfo)) {
        return false;
      }
      PropTimelineInfo other = (PropTimelineInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasKBFLIKKFOEG() || kBFLIKKFOEG == other.kBFLIKKFOEG)
        && (!hasCOOGIPJIPIA() || cOOGIPJIPIA.equals(other.cOOGIPJIPIA));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 24);
        output.writeBoolNoTag(kBFLIKKFOEG);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 98);
        output.writeBytesNoTag(cOOGIPJIPIA);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeBytesSizeNoTag(cOOGIPJIPIA);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public PropTimelineInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 24: {
            // kBFLIKKFOEG
            kBFLIKKFOEG = input.readBool();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 98) {
              break;
            }
          }
          case 98: {
            // cOOGIPJIPIA
            input.readBytes(cOOGIPJIPIA);
            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.writeBool(FieldNames.kBFLIKKFOEG, kBFLIKKFOEG);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeBytes(FieldNames.cOOGIPJIPIA, cOOGIPJIPIA);
      }
      output.endObject();
    }

    @Override
    public PropTimelineInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -1788643561: {
            if (input.isAtField(FieldNames.kBFLIKKFOEG)) {
              if (!input.trySkipNullValue()) {
                kBFLIKKFOEG = input.readBool();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1921635522: {
            if (input.isAtField(FieldNames.cOOGIPJIPIA)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(cOOGIPJIPIA);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum PropTimelineInfoFactory implements MessageFactory<PropTimelineInfo> {
      INSTANCE;

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

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

      static final FieldName cOOGIPJIPIA = FieldName.forField("COOGIPJIPIA");
    }
  }
}
