// Code generated by protocol buffer compiler. Do not edit! package emu.nebula.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; import us.hebi.quickbuf.RepeatedInt; import us.hebi.quickbuf.RepeatedMessage; public final class StorySett { /** * Protobuf type {@code StorySettle} */ public static final class StorySettle extends ProtoMessage implements Cloneable { private static final long serialVersionUID = 0L; /** * optional uint32 Idx = 1; */ private int idx; /** * optional bytes NextPackage = 2047; */ private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance(); /** * repeated .StoryOptions Major = 2; */ private final RepeatedMessage major = RepeatedMessage.newEmptyInstance(StoryOptions.getFactory()); /** * repeated .StoryOptions Personality = 3; */ private final RepeatedMessage personality = RepeatedMessage.newEmptyInstance(StoryOptions.getFactory()); private StorySettle() { } /** * @return a new empty instance of {@code StorySettle} */ public static StorySettle newInstance() { return new StorySettle(); } /** * optional uint32 Idx = 1; * @return whether the idx field is set */ public boolean hasIdx() { return (bitField0_ & 0x00000001) != 0; } /** * optional uint32 Idx = 1; * @return this */ public StorySettle clearIdx() { bitField0_ &= ~0x00000001; idx = 0; return this; } /** * optional uint32 Idx = 1; * @return the idx */ public int getIdx() { return idx; } /** * optional uint32 Idx = 1; * @param value the idx to set * @return this */ public StorySettle setIdx(final int value) { bitField0_ |= 0x00000001; idx = value; return this; } /** * optional bytes NextPackage = 2047; * @return whether the nextPackage field is set */ public boolean hasNextPackage() { return (bitField0_ & 0x00000002) != 0; } /** * optional bytes NextPackage = 2047; * @return this */ public StorySettle clearNextPackage() { bitField0_ &= ~0x00000002; nextPackage.clear(); return this; } /** * optional bytes NextPackage = 2047; * * 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 #getMutableNextPackage()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedByte getNextPackage() { return nextPackage; } /** * optional bytes NextPackage = 2047; * * 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 getMutableNextPackage() { bitField0_ |= 0x00000002; return nextPackage; } /** * optional bytes NextPackage = 2047; * @param value the nextPackage to add * @return this */ public StorySettle addNextPackage(final byte value) { bitField0_ |= 0x00000002; nextPackage.add(value); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to add * @return this */ public StorySettle addAllNextPackage(final byte... values) { bitField0_ |= 0x00000002; nextPackage.addAll(values); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to set * @return this */ public StorySettle setNextPackage(final byte... values) { bitField0_ |= 0x00000002; nextPackage.copyFrom(values); return this; } /** * repeated .StoryOptions Major = 2; * @return whether the major field is set */ public boolean hasMajor() { return (bitField0_ & 0x00000004) != 0; } /** * repeated .StoryOptions Major = 2; * @return this */ public StorySettle clearMajor() { bitField0_ &= ~0x00000004; major.clear(); return this; } /** * repeated .StoryOptions Major = 2; * * 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 #getMutableMajor()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedMessage getMajor() { return major; } /** * repeated .StoryOptions Major = 2; * * 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 RepeatedMessage getMutableMajor() { bitField0_ |= 0x00000004; return major; } /** * repeated .StoryOptions Major = 2; * @param value the major to add * @return this */ public StorySettle addMajor(final StoryOptions value) { bitField0_ |= 0x00000004; major.add(value); return this; } /** * repeated .StoryOptions Major = 2; * @param values the major to add * @return this */ public StorySettle addAllMajor(final StoryOptions... values) { bitField0_ |= 0x00000004; major.addAll(values); return this; } /** * repeated .StoryOptions Personality = 3; * @return whether the personality field is set */ public boolean hasPersonality() { return (bitField0_ & 0x00000008) != 0; } /** * repeated .StoryOptions Personality = 3; * @return this */ public StorySettle clearPersonality() { bitField0_ &= ~0x00000008; personality.clear(); return this; } /** * repeated .StoryOptions Personality = 3; * * 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 #getMutablePersonality()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedMessage getPersonality() { return personality; } /** * repeated .StoryOptions Personality = 3; * * 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 RepeatedMessage getMutablePersonality() { bitField0_ |= 0x00000008; return personality; } /** * repeated .StoryOptions Personality = 3; * @param value the personality to add * @return this */ public StorySettle addPersonality(final StoryOptions value) { bitField0_ |= 0x00000008; personality.add(value); return this; } /** * repeated .StoryOptions Personality = 3; * @param values the personality to add * @return this */ public StorySettle addAllPersonality(final StoryOptions... values) { bitField0_ |= 0x00000008; personality.addAll(values); return this; } @Override public StorySettle copyFrom(final StorySettle other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; idx = other.idx; nextPackage.copyFrom(other.nextPackage); major.copyFrom(other.major); personality.copyFrom(other.personality); } return this; } @Override public StorySettle mergeFrom(final StorySettle other) { if (other.isEmpty()) { return this; } cachedSize = -1; if (other.hasIdx()) { setIdx(other.idx); } if (other.hasNextPackage()) { getMutableNextPackage().copyFrom(other.nextPackage); } if (other.hasMajor()) { getMutableMajor().addAll(other.major); } if (other.hasPersonality()) { getMutablePersonality().addAll(other.personality); } return this; } @Override public StorySettle clear() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; idx = 0; nextPackage.clear(); major.clear(); personality.clear(); return this; } @Override public StorySettle clearQuick() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; nextPackage.clear(); major.clearQuick(); personality.clearQuick(); return this; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof StorySettle)) { return false; } StorySettle other = (StorySettle) o; return bitField0_ == other.bitField0_ && (!hasIdx() || idx == other.idx) && (!hasNextPackage() || nextPackage.equals(other.nextPackage)) && (!hasMajor() || major.equals(other.major)) && (!hasPersonality() || personality.equals(other.personality)); } @Override public void writeTo(final ProtoSink output) throws IOException { if ((bitField0_ & 0x00000001) != 0) { output.writeRawByte((byte) 8); output.writeUInt32NoTag(idx); } if ((bitField0_ & 0x00000002) != 0) { output.writeRawLittleEndian16((short) 32762); output.writeBytesNoTag(nextPackage); } if ((bitField0_ & 0x00000004) != 0) { for (int i = 0; i < major.length(); i++) { output.writeRawByte((byte) 18); output.writeMessageNoTag(major.get(i)); } } if ((bitField0_ & 0x00000008) != 0) { for (int i = 0; i < personality.length(); i++) { output.writeRawByte((byte) 26); output.writeMessageNoTag(personality.get(i)); } } } @Override protected int computeSerializedSize() { int size = 0; if ((bitField0_ & 0x00000001) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(idx); } if ((bitField0_ & 0x00000002) != 0) { size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage); } if ((bitField0_ & 0x00000004) != 0) { size += (1 * major.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(major); } if ((bitField0_ & 0x00000008) != 0) { size += (1 * personality.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(personality); } return size; } @Override @SuppressWarnings("fallthrough") public StorySettle mergeFrom(final ProtoSource input) throws IOException { // Enabled Fall-Through Optimization (QuickBuffers) int tag = input.readTag(); while (true) { switch (tag) { case 8: { // idx idx = input.readUInt32(); bitField0_ |= 0x00000001; tag = input.readTag(); if (tag != 16378) { break; } } case 16378: { // nextPackage input.readBytes(nextPackage); bitField0_ |= 0x00000002; tag = input.readTag(); if (tag != 18) { break; } } case 18: { // major tag = input.readRepeatedMessage(major, tag); bitField0_ |= 0x00000004; if (tag != 26) { break; } } case 26: { // personality tag = input.readRepeatedMessage(personality, tag); bitField0_ |= 0x00000008; 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.idx, idx); } if ((bitField0_ & 0x00000002) != 0) { output.writeBytes(FieldNames.nextPackage, nextPackage); } if ((bitField0_ & 0x00000004) != 0) { output.writeRepeatedMessage(FieldNames.major, major); } if ((bitField0_ & 0x00000008) != 0) { output.writeRepeatedMessage(FieldNames.personality, personality); } output.endObject(); } @Override public StorySettle mergeFrom(final JsonSource input) throws IOException { if (!input.beginObject()) { return this; } while (!input.isAtEnd()) { switch (input.readFieldHash()) { case 73373: { if (input.isAtField(FieldNames.idx)) { if (!input.trySkipNullValue()) { idx = input.readUInt32(); bitField0_ |= 0x00000001; } } else { input.skipUnknownField(); } break; } case -2082324045: { if (input.isAtField(FieldNames.nextPackage)) { if (!input.trySkipNullValue()) { input.readBytes(nextPackage); bitField0_ |= 0x00000002; } } else { input.skipUnknownField(); } break; } case 74106265: { if (input.isAtField(FieldNames.major)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(major); bitField0_ |= 0x00000004; } } else { input.skipUnknownField(); } break; } case 1243902542: { if (input.isAtField(FieldNames.personality)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(personality); bitField0_ |= 0x00000008; } } else { input.skipUnknownField(); } break; } default: { input.skipUnknownField(); break; } } } input.endObject(); return this; } @Override public StorySettle clone() { return new StorySettle().copyFrom(this); } @Override public boolean isEmpty() { return ((bitField0_) == 0); } public static StorySettle parseFrom(final byte[] data) throws InvalidProtocolBufferException { return ProtoMessage.mergeFrom(new StorySettle(), data).checkInitialized(); } public static StorySettle parseFrom(final ProtoSource input) throws IOException { return ProtoMessage.mergeFrom(new StorySettle(), input).checkInitialized(); } public static StorySettle parseFrom(final JsonSource input) throws IOException { return ProtoMessage.mergeFrom(new StorySettle(), input).checkInitialized(); } /** * @return factory for creating StorySettle messages */ public static MessageFactory getFactory() { return StorySettleFactory.INSTANCE; } private enum StorySettleFactory implements MessageFactory { INSTANCE; @Override public StorySettle create() { return StorySettle.newInstance(); } } /** * Contains name constants used for serializing JSON */ static class FieldNames { static final FieldName idx = FieldName.forField("Idx"); static final FieldName nextPackage = FieldName.forField("NextPackage"); static final FieldName major = FieldName.forField("Major"); static final FieldName personality = FieldName.forField("Personality"); } } /** * Protobuf type {@code StorySettleReq} */ public static final class StorySettleReq extends ProtoMessage implements Cloneable { private static final long serialVersionUID = 0L; /** * optional .Events Events = 14; */ private final Public.Events events = Public.Events.newInstance(); /** * optional bytes NextPackage = 2047; */ private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance(); /** * repeated uint32 Evidences = 15; */ private final RepeatedInt evidences = RepeatedInt.newEmptyInstance(); /** * repeated .StorySettle List = 1; */ private final RepeatedMessage list = RepeatedMessage.newEmptyInstance(StorySettle.getFactory()); private StorySettleReq() { } /** * @return a new empty instance of {@code StorySettleReq} */ public static StorySettleReq newInstance() { return new StorySettleReq(); } /** * optional .Events Events = 14; * @return whether the events field is set */ public boolean hasEvents() { return (bitField0_ & 0x00000001) != 0; } /** * optional .Events Events = 14; * @return this */ public StorySettleReq clearEvents() { bitField0_ &= ~0x00000001; events.clear(); return this; } /** * optional .Events Events = 14; * * 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 #getMutableEvents()} if you want to modify it. * * @return internal storage object for reading */ public Public.Events getEvents() { return events; } /** * optional .Events Events = 14; * * 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 Public.Events getMutableEvents() { bitField0_ |= 0x00000001; return events; } /** * optional .Events Events = 14; * @param value the events to set * @return this */ public StorySettleReq setEvents(final Public.Events value) { bitField0_ |= 0x00000001; events.copyFrom(value); return this; } /** * optional bytes NextPackage = 2047; * @return whether the nextPackage field is set */ public boolean hasNextPackage() { return (bitField0_ & 0x00000002) != 0; } /** * optional bytes NextPackage = 2047; * @return this */ public StorySettleReq clearNextPackage() { bitField0_ &= ~0x00000002; nextPackage.clear(); return this; } /** * optional bytes NextPackage = 2047; * * 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 #getMutableNextPackage()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedByte getNextPackage() { return nextPackage; } /** * optional bytes NextPackage = 2047; * * 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 getMutableNextPackage() { bitField0_ |= 0x00000002; return nextPackage; } /** * optional bytes NextPackage = 2047; * @param value the nextPackage to add * @return this */ public StorySettleReq addNextPackage(final byte value) { bitField0_ |= 0x00000002; nextPackage.add(value); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to add * @return this */ public StorySettleReq addAllNextPackage(final byte... values) { bitField0_ |= 0x00000002; nextPackage.addAll(values); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to set * @return this */ public StorySettleReq setNextPackage(final byte... values) { bitField0_ |= 0x00000002; nextPackage.copyFrom(values); return this; } /** * repeated uint32 Evidences = 15; * @return whether the evidences field is set */ public boolean hasEvidences() { return (bitField0_ & 0x00000004) != 0; } /** * repeated uint32 Evidences = 15; * @return this */ public StorySettleReq clearEvidences() { bitField0_ &= ~0x00000004; evidences.clear(); return this; } /** * repeated uint32 Evidences = 15; * * 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 #getMutableEvidences()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedInt getEvidences() { return evidences; } /** * repeated uint32 Evidences = 15; * * 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 RepeatedInt getMutableEvidences() { bitField0_ |= 0x00000004; return evidences; } /** * repeated uint32 Evidences = 15; * @param value the evidences to add * @return this */ public StorySettleReq addEvidences(final int value) { bitField0_ |= 0x00000004; evidences.add(value); return this; } /** * repeated uint32 Evidences = 15; * @param values the evidences to add * @return this */ public StorySettleReq addAllEvidences(final int... values) { bitField0_ |= 0x00000004; evidences.addAll(values); return this; } /** * repeated .StorySettle List = 1; * @return whether the list field is set */ public boolean hasList() { return (bitField0_ & 0x00000008) != 0; } /** * repeated .StorySettle List = 1; * @return this */ public StorySettleReq clearList() { bitField0_ &= ~0x00000008; list.clear(); return this; } /** * repeated .StorySettle List = 1; * * 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 #getMutableList()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedMessage getList() { return list; } /** * repeated .StorySettle List = 1; * * 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 RepeatedMessage getMutableList() { bitField0_ |= 0x00000008; return list; } /** * repeated .StorySettle List = 1; * @param value the list to add * @return this */ public StorySettleReq addList(final StorySettle value) { bitField0_ |= 0x00000008; list.add(value); return this; } /** * repeated .StorySettle List = 1; * @param values the list to add * @return this */ public StorySettleReq addAllList(final StorySettle... values) { bitField0_ |= 0x00000008; list.addAll(values); return this; } @Override public StorySettleReq copyFrom(final StorySettleReq other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; events.copyFrom(other.events); nextPackage.copyFrom(other.nextPackage); evidences.copyFrom(other.evidences); list.copyFrom(other.list); } return this; } @Override public StorySettleReq mergeFrom(final StorySettleReq other) { if (other.isEmpty()) { return this; } cachedSize = -1; if (other.hasEvents()) { getMutableEvents().mergeFrom(other.events); } if (other.hasNextPackage()) { getMutableNextPackage().copyFrom(other.nextPackage); } if (other.hasEvidences()) { getMutableEvidences().addAll(other.evidences); } if (other.hasList()) { getMutableList().addAll(other.list); } return this; } @Override public StorySettleReq clear() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; events.clear(); nextPackage.clear(); evidences.clear(); list.clear(); return this; } @Override public StorySettleReq clearQuick() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; events.clearQuick(); nextPackage.clear(); evidences.clear(); list.clearQuick(); return this; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof StorySettleReq)) { return false; } StorySettleReq other = (StorySettleReq) o; return bitField0_ == other.bitField0_ && (!hasEvents() || events.equals(other.events)) && (!hasNextPackage() || nextPackage.equals(other.nextPackage)) && (!hasEvidences() || evidences.equals(other.evidences)) && (!hasList() || list.equals(other.list)); } @Override public void writeTo(final ProtoSink output) throws IOException { if ((bitField0_ & 0x00000001) != 0) { output.writeRawByte((byte) 114); output.writeMessageNoTag(events); } if ((bitField0_ & 0x00000002) != 0) { output.writeRawLittleEndian16((short) 32762); output.writeBytesNoTag(nextPackage); } if ((bitField0_ & 0x00000004) != 0) { for (int i = 0; i < evidences.length(); i++) { output.writeRawByte((byte) 120); output.writeUInt32NoTag(evidences.array()[i]); } } if ((bitField0_ & 0x00000008) != 0) { for (int i = 0; i < list.length(); i++) { output.writeRawByte((byte) 10); output.writeMessageNoTag(list.get(i)); } } } @Override protected int computeSerializedSize() { int size = 0; if ((bitField0_ & 0x00000001) != 0) { size += 1 + ProtoSink.computeMessageSizeNoTag(events); } if ((bitField0_ & 0x00000002) != 0) { size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage); } if ((bitField0_ & 0x00000004) != 0) { size += (1 * evidences.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(evidences); } if ((bitField0_ & 0x00000008) != 0) { size += (1 * list.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(list); } return size; } @Override @SuppressWarnings("fallthrough") public StorySettleReq mergeFrom(final ProtoSource input) throws IOException { // Enabled Fall-Through Optimization (QuickBuffers) int tag = input.readTag(); while (true) { switch (tag) { case 114: { // events input.readMessage(events); bitField0_ |= 0x00000001; tag = input.readTag(); if (tag != 16378) { break; } } case 16378: { // nextPackage input.readBytes(nextPackage); bitField0_ |= 0x00000002; tag = input.readTag(); if (tag != 122) { break; } } case 122: { // evidences [packed=true] input.readPackedUInt32(evidences, tag); bitField0_ |= 0x00000004; tag = input.readTag(); if (tag != 10) { break; } } case 10: { // list tag = input.readRepeatedMessage(list, tag); bitField0_ |= 0x00000008; if (tag != 0) { break; } } case 0: { return this; } default: { if (!input.skipField(tag)) { return this; } tag = input.readTag(); break; } case 120: { // evidences [packed=false] tag = input.readRepeatedUInt32(evidences, tag); bitField0_ |= 0x00000004; break; } } } } @Override public void writeTo(final JsonSink output) throws IOException { output.beginObject(); if ((bitField0_ & 0x00000001) != 0) { output.writeMessage(FieldNames.events, events); } if ((bitField0_ & 0x00000002) != 0) { output.writeBytes(FieldNames.nextPackage, nextPackage); } if ((bitField0_ & 0x00000004) != 0) { output.writeRepeatedUInt32(FieldNames.evidences, evidences); } if ((bitField0_ & 0x00000008) != 0) { output.writeRepeatedMessage(FieldNames.list, list); } output.endObject(); } @Override public StorySettleReq mergeFrom(final JsonSource input) throws IOException { if (!input.beginObject()) { return this; } while (!input.isAtEnd()) { switch (input.readFieldHash()) { case 2087505209: { if (input.isAtField(FieldNames.events)) { if (!input.trySkipNullValue()) { input.readMessage(events); bitField0_ |= 0x00000001; } } else { input.skipUnknownField(); } break; } case -2082324045: { if (input.isAtField(FieldNames.nextPackage)) { if (!input.trySkipNullValue()) { input.readBytes(nextPackage); bitField0_ |= 0x00000002; } } else { input.skipUnknownField(); } break; } case 991055068: { if (input.isAtField(FieldNames.evidences)) { if (!input.trySkipNullValue()) { input.readRepeatedUInt32(evidences); bitField0_ |= 0x00000004; } } else { input.skipUnknownField(); } break; } case 2368702: { if (input.isAtField(FieldNames.list)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(list); bitField0_ |= 0x00000008; } } else { input.skipUnknownField(); } break; } default: { input.skipUnknownField(); break; } } } input.endObject(); return this; } @Override public StorySettleReq clone() { return new StorySettleReq().copyFrom(this); } @Override public boolean isEmpty() { return ((bitField0_) == 0); } public static StorySettleReq parseFrom(final byte[] data) throws InvalidProtocolBufferException { return ProtoMessage.mergeFrom(new StorySettleReq(), data).checkInitialized(); } public static StorySettleReq parseFrom(final ProtoSource input) throws IOException { return ProtoMessage.mergeFrom(new StorySettleReq(), input).checkInitialized(); } public static StorySettleReq parseFrom(final JsonSource input) throws IOException { return ProtoMessage.mergeFrom(new StorySettleReq(), input).checkInitialized(); } /** * @return factory for creating StorySettleReq messages */ public static MessageFactory getFactory() { return StorySettleReqFactory.INSTANCE; } private enum StorySettleReqFactory implements MessageFactory { INSTANCE; @Override public StorySettleReq create() { return StorySettleReq.newInstance(); } } /** * Contains name constants used for serializing JSON */ static class FieldNames { static final FieldName events = FieldName.forField("Events"); static final FieldName nextPackage = FieldName.forField("NextPackage"); static final FieldName evidences = FieldName.forField("Evidences"); static final FieldName list = FieldName.forField("List"); } } /** * Protobuf type {@code StoryOptions} */ public static final class StoryOptions extends ProtoMessage implements Cloneable { private static final long serialVersionUID = 0L; /** * optional uint32 Group = 1; */ private int group; /** * optional uint32 Choice = 2; */ private int choice; /** * optional uint32 Factor = 3; */ private int factor; /** * optional bytes NextPackage = 2047; */ private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance(); private StoryOptions() { } /** * @return a new empty instance of {@code StoryOptions} */ public static StoryOptions newInstance() { return new StoryOptions(); } /** * optional uint32 Group = 1; * @return whether the group field is set */ public boolean hasGroup() { return (bitField0_ & 0x00000001) != 0; } /** * optional uint32 Group = 1; * @return this */ public StoryOptions clearGroup() { bitField0_ &= ~0x00000001; group = 0; return this; } /** * optional uint32 Group = 1; * @return the group */ public int getGroup() { return group; } /** * optional uint32 Group = 1; * @param value the group to set * @return this */ public StoryOptions setGroup(final int value) { bitField0_ |= 0x00000001; group = value; return this; } /** * optional uint32 Choice = 2; * @return whether the choice field is set */ public boolean hasChoice() { return (bitField0_ & 0x00000002) != 0; } /** * optional uint32 Choice = 2; * @return this */ public StoryOptions clearChoice() { bitField0_ &= ~0x00000002; choice = 0; return this; } /** * optional uint32 Choice = 2; * @return the choice */ public int getChoice() { return choice; } /** * optional uint32 Choice = 2; * @param value the choice to set * @return this */ public StoryOptions setChoice(final int value) { bitField0_ |= 0x00000002; choice = value; return this; } /** * optional uint32 Factor = 3; * @return whether the factor field is set */ public boolean hasFactor() { return (bitField0_ & 0x00000004) != 0; } /** * optional uint32 Factor = 3; * @return this */ public StoryOptions clearFactor() { bitField0_ &= ~0x00000004; factor = 0; return this; } /** * optional uint32 Factor = 3; * @return the factor */ public int getFactor() { return factor; } /** * optional uint32 Factor = 3; * @param value the factor to set * @return this */ public StoryOptions setFactor(final int value) { bitField0_ |= 0x00000004; factor = value; return this; } /** * optional bytes NextPackage = 2047; * @return whether the nextPackage field is set */ public boolean hasNextPackage() { return (bitField0_ & 0x00000008) != 0; } /** * optional bytes NextPackage = 2047; * @return this */ public StoryOptions clearNextPackage() { bitField0_ &= ~0x00000008; nextPackage.clear(); return this; } /** * optional bytes NextPackage = 2047; * * 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 #getMutableNextPackage()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedByte getNextPackage() { return nextPackage; } /** * optional bytes NextPackage = 2047; * * 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 getMutableNextPackage() { bitField0_ |= 0x00000008; return nextPackage; } /** * optional bytes NextPackage = 2047; * @param value the nextPackage to add * @return this */ public StoryOptions addNextPackage(final byte value) { bitField0_ |= 0x00000008; nextPackage.add(value); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to add * @return this */ public StoryOptions addAllNextPackage(final byte... values) { bitField0_ |= 0x00000008; nextPackage.addAll(values); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to set * @return this */ public StoryOptions setNextPackage(final byte... values) { bitField0_ |= 0x00000008; nextPackage.copyFrom(values); return this; } @Override public StoryOptions copyFrom(final StoryOptions other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; group = other.group; choice = other.choice; factor = other.factor; nextPackage.copyFrom(other.nextPackage); } return this; } @Override public StoryOptions mergeFrom(final StoryOptions other) { if (other.isEmpty()) { return this; } cachedSize = -1; if (other.hasGroup()) { setGroup(other.group); } if (other.hasChoice()) { setChoice(other.choice); } if (other.hasFactor()) { setFactor(other.factor); } if (other.hasNextPackage()) { getMutableNextPackage().copyFrom(other.nextPackage); } return this; } @Override public StoryOptions clear() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; group = 0; choice = 0; factor = 0; nextPackage.clear(); return this; } @Override public StoryOptions clearQuick() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; nextPackage.clear(); return this; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof StoryOptions)) { return false; } StoryOptions other = (StoryOptions) o; return bitField0_ == other.bitField0_ && (!hasGroup() || group == other.group) && (!hasChoice() || choice == other.choice) && (!hasFactor() || factor == other.factor) && (!hasNextPackage() || nextPackage.equals(other.nextPackage)); } @Override public void writeTo(final ProtoSink output) throws IOException { if ((bitField0_ & 0x00000001) != 0) { output.writeRawByte((byte) 8); output.writeUInt32NoTag(group); } if ((bitField0_ & 0x00000002) != 0) { output.writeRawByte((byte) 16); output.writeUInt32NoTag(choice); } if ((bitField0_ & 0x00000004) != 0) { output.writeRawByte((byte) 24); output.writeUInt32NoTag(factor); } if ((bitField0_ & 0x00000008) != 0) { output.writeRawLittleEndian16((short) 32762); output.writeBytesNoTag(nextPackage); } } @Override protected int computeSerializedSize() { int size = 0; if ((bitField0_ & 0x00000001) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(group); } if ((bitField0_ & 0x00000002) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(choice); } if ((bitField0_ & 0x00000004) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(factor); } if ((bitField0_ & 0x00000008) != 0) { size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage); } return size; } @Override @SuppressWarnings("fallthrough") public StoryOptions mergeFrom(final ProtoSource input) throws IOException { // Enabled Fall-Through Optimization (QuickBuffers) int tag = input.readTag(); while (true) { switch (tag) { case 8: { // group group = input.readUInt32(); bitField0_ |= 0x00000001; tag = input.readTag(); if (tag != 16) { break; } } case 16: { // choice choice = input.readUInt32(); bitField0_ |= 0x00000002; tag = input.readTag(); if (tag != 24) { break; } } case 24: { // factor factor = input.readUInt32(); bitField0_ |= 0x00000004; tag = input.readTag(); if (tag != 16378) { break; } } case 16378: { // nextPackage input.readBytes(nextPackage); 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.group, group); } if ((bitField0_ & 0x00000002) != 0) { output.writeUInt32(FieldNames.choice, choice); } if ((bitField0_ & 0x00000004) != 0) { output.writeUInt32(FieldNames.factor, factor); } if ((bitField0_ & 0x00000008) != 0) { output.writeBytes(FieldNames.nextPackage, nextPackage); } output.endObject(); } @Override public StoryOptions mergeFrom(final JsonSource input) throws IOException { if (!input.beginObject()) { return this; } while (!input.isAtEnd()) { switch (input.readFieldHash()) { case 69076575: { if (input.isAtField(FieldNames.group)) { if (!input.trySkipNullValue()) { group = input.readUInt32(); bitField0_ |= 0x00000001; } } else { input.skipUnknownField(); } break; } case 2017610177: { if (input.isAtField(FieldNames.choice)) { if (!input.trySkipNullValue()) { choice = input.readUInt32(); bitField0_ |= 0x00000002; } } else { input.skipUnknownField(); } break; } case 2096686447: { if (input.isAtField(FieldNames.factor)) { if (!input.trySkipNullValue()) { factor = input.readUInt32(); bitField0_ |= 0x00000004; } } else { input.skipUnknownField(); } break; } case -2082324045: { if (input.isAtField(FieldNames.nextPackage)) { if (!input.trySkipNullValue()) { input.readBytes(nextPackage); bitField0_ |= 0x00000008; } } else { input.skipUnknownField(); } break; } default: { input.skipUnknownField(); break; } } } input.endObject(); return this; } @Override public StoryOptions clone() { return new StoryOptions().copyFrom(this); } @Override public boolean isEmpty() { return ((bitField0_) == 0); } public static StoryOptions parseFrom(final byte[] data) throws InvalidProtocolBufferException { return ProtoMessage.mergeFrom(new StoryOptions(), data).checkInitialized(); } public static StoryOptions parseFrom(final ProtoSource input) throws IOException { return ProtoMessage.mergeFrom(new StoryOptions(), input).checkInitialized(); } public static StoryOptions parseFrom(final JsonSource input) throws IOException { return ProtoMessage.mergeFrom(new StoryOptions(), input).checkInitialized(); } /** * @return factory for creating StoryOptions messages */ public static MessageFactory getFactory() { return StoryOptionsFactory.INSTANCE; } private enum StoryOptionsFactory implements MessageFactory { INSTANCE; @Override public StoryOptions create() { return StoryOptions.newInstance(); } } /** * Contains name constants used for serializing JSON */ static class FieldNames { static final FieldName group = FieldName.forField("Group"); static final FieldName choice = FieldName.forField("Choice"); static final FieldName factor = FieldName.forField("Factor"); static final FieldName nextPackage = FieldName.forField("NextPackage"); } } }