// 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.RepeatedMessage; import us.hebi.quickbuf.Utf8String; public final class PotentialPreselectionImport { /** * Protobuf type {@code PotentialPreselectionImportReq} */ public static final class PotentialPreselectionImportReq extends ProtoMessage implements Cloneable { private static final long serialVersionUID = 0L; /** * optional bool Preference = 2; */ private boolean preference; /** * optional bytes NextPackage = 2047; */ private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance(); /** * optional string Name = 1; */ private final Utf8String name = Utf8String.newEmptyInstance(); /** * repeated .StarTowerBookCharPotential CharPotentials = 3; */ private final RepeatedMessage charPotentials = RepeatedMessage.newEmptyInstance(PublicStarTower.StarTowerBookCharPotential.getFactory()); private PotentialPreselectionImportReq() { } /** * @return a new empty instance of {@code PotentialPreselectionImportReq} */ public static PotentialPreselectionImportReq newInstance() { return new PotentialPreselectionImportReq(); } /** * optional bool Preference = 2; * @return whether the preference field is set */ public boolean hasPreference() { return (bitField0_ & 0x00000001) != 0; } /** * optional bool Preference = 2; * @return this */ public PotentialPreselectionImportReq clearPreference() { bitField0_ &= ~0x00000001; preference = false; return this; } /** * optional bool Preference = 2; * @return the preference */ public boolean getPreference() { return preference; } /** * optional bool Preference = 2; * @param value the preference to set * @return this */ public PotentialPreselectionImportReq setPreference(final boolean value) { bitField0_ |= 0x00000001; preference = 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 PotentialPreselectionImportReq 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 PotentialPreselectionImportReq addNextPackage(final byte value) { bitField0_ |= 0x00000002; nextPackage.add(value); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to add * @return this */ public PotentialPreselectionImportReq addAllNextPackage(final byte... values) { bitField0_ |= 0x00000002; nextPackage.addAll(values); return this; } /** * optional bytes NextPackage = 2047; * @param values the nextPackage to set * @return this */ public PotentialPreselectionImportReq setNextPackage(final byte... values) { bitField0_ |= 0x00000002; nextPackage.copyFrom(values); return this; } /** * optional string Name = 1; * @return whether the name field is set */ public boolean hasName() { return (bitField0_ & 0x00000004) != 0; } /** * optional string Name = 1; * @return this */ public PotentialPreselectionImportReq clearName() { bitField0_ &= ~0x00000004; name.clear(); return this; } /** * optional string Name = 1; * @return the name */ public String getName() { return name.getString(); } /** * optional string Name = 1; * @return internal {@code Utf8String} representation of name for reading */ public Utf8String getNameBytes() { return this.name; } /** * optional string Name = 1; * @return internal {@code Utf8String} representation of name for modifications */ public Utf8String getMutableNameBytes() { bitField0_ |= 0x00000004; return this.name; } /** * optional string Name = 1; * @param value the name to set * @return this */ public PotentialPreselectionImportReq setName(final CharSequence value) { bitField0_ |= 0x00000004; name.copyFrom(value); return this; } /** * optional string Name = 1; * @param value the name to set * @return this */ public PotentialPreselectionImportReq setName(final Utf8String value) { bitField0_ |= 0x00000004; name.copyFrom(value); return this; } /** * repeated .StarTowerBookCharPotential CharPotentials = 3; * @return whether the charPotentials field is set */ public boolean hasCharPotentials() { return (bitField0_ & 0x00000008) != 0; } /** * repeated .StarTowerBookCharPotential CharPotentials = 3; * @return this */ public PotentialPreselectionImportReq clearCharPotentials() { bitField0_ &= ~0x00000008; charPotentials.clear(); return this; } /** * repeated .StarTowerBookCharPotential CharPotentials = 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 #getMutableCharPotentials()} if you want to modify it. * * @return internal storage object for reading */ public RepeatedMessage getCharPotentials() { return charPotentials; } /** * repeated .StarTowerBookCharPotential CharPotentials = 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 getMutableCharPotentials() { bitField0_ |= 0x00000008; return charPotentials; } /** * repeated .StarTowerBookCharPotential CharPotentials = 3; * @param value the charPotentials to add * @return this */ public PotentialPreselectionImportReq addCharPotentials( final PublicStarTower.StarTowerBookCharPotential value) { bitField0_ |= 0x00000008; charPotentials.add(value); return this; } /** * repeated .StarTowerBookCharPotential CharPotentials = 3; * @param values the charPotentials to add * @return this */ public PotentialPreselectionImportReq addAllCharPotentials( final PublicStarTower.StarTowerBookCharPotential... values) { bitField0_ |= 0x00000008; charPotentials.addAll(values); return this; } @Override public PotentialPreselectionImportReq copyFrom(final PotentialPreselectionImportReq other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; preference = other.preference; nextPackage.copyFrom(other.nextPackage); name.copyFrom(other.name); charPotentials.copyFrom(other.charPotentials); } return this; } @Override public PotentialPreselectionImportReq mergeFrom(final PotentialPreselectionImportReq other) { if (other.isEmpty()) { return this; } cachedSize = -1; if (other.hasPreference()) { setPreference(other.preference); } if (other.hasNextPackage()) { getMutableNextPackage().copyFrom(other.nextPackage); } if (other.hasName()) { getMutableNameBytes().copyFrom(other.name); } if (other.hasCharPotentials()) { getMutableCharPotentials().addAll(other.charPotentials); } return this; } @Override public PotentialPreselectionImportReq clear() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; preference = false; nextPackage.clear(); name.clear(); charPotentials.clear(); return this; } @Override public PotentialPreselectionImportReq clearQuick() { if (isEmpty()) { return this; } cachedSize = -1; bitField0_ = 0; nextPackage.clear(); name.clear(); charPotentials.clearQuick(); return this; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof PotentialPreselectionImportReq)) { return false; } PotentialPreselectionImportReq other = (PotentialPreselectionImportReq) o; return bitField0_ == other.bitField0_ && (!hasPreference() || preference == other.preference) && (!hasNextPackage() || nextPackage.equals(other.nextPackage)) && (!hasName() || name.equals(other.name)) && (!hasCharPotentials() || charPotentials.equals(other.charPotentials)); } @Override public void writeTo(final ProtoSink output) throws IOException { if ((bitField0_ & 0x00000001) != 0) { output.writeRawByte((byte) 16); output.writeBoolNoTag(preference); } if ((bitField0_ & 0x00000002) != 0) { output.writeRawLittleEndian16((short) 32762); output.writeBytesNoTag(nextPackage); } if ((bitField0_ & 0x00000004) != 0) { output.writeRawByte((byte) 10); output.writeStringNoTag(name); } if ((bitField0_ & 0x00000008) != 0) { for (int i = 0; i < charPotentials.length(); i++) { output.writeRawByte((byte) 26); output.writeMessageNoTag(charPotentials.get(i)); } } } @Override protected int computeSerializedSize() { int size = 0; if ((bitField0_ & 0x00000001) != 0) { size += 2; } if ((bitField0_ & 0x00000002) != 0) { size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage); } if ((bitField0_ & 0x00000004) != 0) { size += 1 + ProtoSink.computeStringSizeNoTag(name); } if ((bitField0_ & 0x00000008) != 0) { size += (1 * charPotentials.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(charPotentials); } return size; } @Override @SuppressWarnings("fallthrough") public PotentialPreselectionImportReq mergeFrom(final ProtoSource input) throws IOException { // Enabled Fall-Through Optimization (QuickBuffers) int tag = input.readTag(); while (true) { switch (tag) { case 16: { // preference preference = input.readBool(); bitField0_ |= 0x00000001; tag = input.readTag(); if (tag != 16378) { break; } } case 16378: { // nextPackage input.readBytes(nextPackage); bitField0_ |= 0x00000002; tag = input.readTag(); if (tag != 10) { break; } } case 10: { // name input.readString(name); bitField0_ |= 0x00000004; tag = input.readTag(); if (tag != 26) { break; } } case 26: { // charPotentials tag = input.readRepeatedMessage(charPotentials, 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.writeBool(FieldNames.preference, preference); } if ((bitField0_ & 0x00000002) != 0) { output.writeBytes(FieldNames.nextPackage, nextPackage); } if ((bitField0_ & 0x00000004) != 0) { output.writeString(FieldNames.name, name); } if ((bitField0_ & 0x00000008) != 0) { output.writeRepeatedMessage(FieldNames.charPotentials, charPotentials); } output.endObject(); } @Override public PotentialPreselectionImportReq mergeFrom(final JsonSource input) throws IOException { if (!input.beginObject()) { return this; } while (!input.isAtEnd()) { switch (input.readFieldHash()) { case 533633275: { if (input.isAtField(FieldNames.preference)) { if (!input.trySkipNullValue()) { preference = input.readBool(); 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 2420395: { if (input.isAtField(FieldNames.name)) { if (!input.trySkipNullValue()) { input.readString(name); bitField0_ |= 0x00000004; } } else { input.skipUnknownField(); } break; } case -1909208021: { if (input.isAtField(FieldNames.charPotentials)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(charPotentials); bitField0_ |= 0x00000008; } } else { input.skipUnknownField(); } break; } default: { input.skipUnknownField(); break; } } } input.endObject(); return this; } @Override public PotentialPreselectionImportReq clone() { return new PotentialPreselectionImportReq().copyFrom(this); } @Override public boolean isEmpty() { return ((bitField0_) == 0); } public static PotentialPreselectionImportReq parseFrom(final byte[] data) throws InvalidProtocolBufferException { return ProtoMessage.mergeFrom(new PotentialPreselectionImportReq(), data).checkInitialized(); } public static PotentialPreselectionImportReq parseFrom(final ProtoSource input) throws IOException { return ProtoMessage.mergeFrom(new PotentialPreselectionImportReq(), input).checkInitialized(); } public static PotentialPreselectionImportReq parseFrom(final JsonSource input) throws IOException { return ProtoMessage.mergeFrom(new PotentialPreselectionImportReq(), input).checkInitialized(); } /** * @return factory for creating PotentialPreselectionImportReq messages */ public static MessageFactory getFactory() { return PotentialPreselectionImportReqFactory.INSTANCE; } private enum PotentialPreselectionImportReqFactory implements MessageFactory { INSTANCE; @Override public PotentialPreselectionImportReq create() { return PotentialPreselectionImportReq.newInstance(); } } /** * Contains name constants used for serializing JSON */ static class FieldNames { static final FieldName preference = FieldName.forField("Preference"); static final FieldName nextPackage = FieldName.forField("NextPackage"); static final FieldName name = FieldName.forField("Name"); static final FieldName charPotentials = FieldName.forField("CharPotentials"); } } }