Skip to content

Commit

Permalink
General refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Jan 7, 2024
1 parent 349b115 commit 6b52f06
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public static final class GroupStateChangeCsReq extends ProtoMessage<GroupStateC
private static final long serialVersionUID = 0L;

/**
* <code>optional .GroupStateInfo group_info = 6;</code>
* <code>optional .GroupStateInfo group_state_info = 6;</code>
*/
private final GroupStateInfoOuterClass.GroupStateInfo groupInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
private final GroupStateInfoOuterClass.GroupStateInfo groupStateInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();

private GroupStateChangeCsReq() {
}
Expand All @@ -34,59 +34,60 @@ public static GroupStateChangeCsReq newInstance() {
}

/**
* <code>optional .GroupStateInfo group_info = 6;</code>
* @return whether the groupInfo field is set
* <code>optional .GroupStateInfo group_state_info = 6;</code>
* @return whether the groupStateInfo field is set
*/
public boolean hasGroupInfo() {
public boolean hasGroupStateInfo() {
return (bitField0_ & 0x00000001) != 0;
}

/**
* <code>optional .GroupStateInfo group_info = 6;</code>
* <code>optional .GroupStateInfo group_state_info = 6;</code>
* @return this
*/
public GroupStateChangeCsReq clearGroupInfo() {
public GroupStateChangeCsReq clearGroupStateInfo() {
bitField0_ &= ~0x00000001;
groupInfo.clear();
groupStateInfo.clear();
return this;
}

/**
* <code>optional .GroupStateInfo group_info = 6;</code>
* <code>optional .GroupStateInfo group_state_info = 6;</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 #getMutableGroupInfo()} if you want to modify it.
* Use {@link #getMutableGroupStateInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public GroupStateInfoOuterClass.GroupStateInfo getGroupInfo() {
return groupInfo;
public GroupStateInfoOuterClass.GroupStateInfo getGroupStateInfo() {
return groupStateInfo;
}

/**
* <code>optional .GroupStateInfo group_info = 6;</code>
* <code>optional .GroupStateInfo group_state_info = 6;</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 GroupStateInfoOuterClass.GroupStateInfo getMutableGroupInfo() {
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupStateInfo() {
bitField0_ |= 0x00000001;
return groupInfo;
return groupStateInfo;
}

/**
* <code>optional .GroupStateInfo group_info = 6;</code>
* @param value the groupInfo to set
* <code>optional .GroupStateInfo group_state_info = 6;</code>
* @param value the groupStateInfo to set
* @return this
*/
public GroupStateChangeCsReq setGroupInfo(final GroupStateInfoOuterClass.GroupStateInfo value) {
public GroupStateChangeCsReq setGroupStateInfo(
final GroupStateInfoOuterClass.GroupStateInfo value) {
bitField0_ |= 0x00000001;
groupInfo.copyFrom(value);
groupStateInfo.copyFrom(value);
return this;
}

Expand All @@ -95,7 +96,7 @@ public GroupStateChangeCsReq copyFrom(final GroupStateChangeCsReq other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
groupInfo.copyFrom(other.groupInfo);
groupStateInfo.copyFrom(other.groupStateInfo);
}
return this;
}
Expand All @@ -106,8 +107,8 @@ public GroupStateChangeCsReq mergeFrom(final GroupStateChangeCsReq other) {
return this;
}
cachedSize = -1;
if (other.hasGroupInfo()) {
getMutableGroupInfo().mergeFrom(other.groupInfo);
if (other.hasGroupStateInfo()) {
getMutableGroupStateInfo().mergeFrom(other.groupStateInfo);
}
return this;
}
Expand All @@ -119,7 +120,7 @@ public GroupStateChangeCsReq clear() {
}
cachedSize = -1;
bitField0_ = 0;
groupInfo.clear();
groupStateInfo.clear();
return this;
}

Expand All @@ -130,7 +131,7 @@ public GroupStateChangeCsReq clearQuick() {
}
cachedSize = -1;
bitField0_ = 0;
groupInfo.clearQuick();
groupStateInfo.clearQuick();
return this;
}

Expand All @@ -144,22 +145,22 @@ public boolean equals(Object o) {
}
GroupStateChangeCsReq other = (GroupStateChangeCsReq) o;
return bitField0_ == other.bitField0_
&& (!hasGroupInfo() || groupInfo.equals(other.groupInfo));
&& (!hasGroupStateInfo() || groupStateInfo.equals(other.groupStateInfo));
}

@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 50);
output.writeMessageNoTag(groupInfo);
output.writeMessageNoTag(groupStateInfo);
}
}

@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(groupInfo);
size += 1 + ProtoSink.computeMessageSizeNoTag(groupStateInfo);
}
return size;
}
Expand All @@ -172,8 +173,8 @@ public GroupStateChangeCsReq mergeFrom(final ProtoSource input) throws IOExcepti
while (true) {
switch (tag) {
case 50: {
// groupInfo
input.readMessage(groupInfo);
// groupStateInfo
input.readMessage(groupStateInfo);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 0) {
Expand All @@ -198,7 +199,7 @@ public GroupStateChangeCsReq mergeFrom(final ProtoSource input) throws IOExcepti
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.groupInfo, groupInfo);
output.writeMessage(FieldNames.groupStateInfo, groupStateInfo);
}
output.endObject();
}
Expand All @@ -210,11 +211,11 @@ public GroupStateChangeCsReq mergeFrom(final JsonSource input) throws IOExceptio
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -1483311155:
case 1282170478: {
if (input.isAtField(FieldNames.groupInfo)) {
case 1415312672:
case 1198732636: {
if (input.isAtField(FieldNames.groupStateInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(groupInfo);
input.readMessage(groupStateInfo);
bitField0_ |= 0x00000001;
}
} else {
Expand Down Expand Up @@ -275,7 +276,7 @@ public GroupStateChangeCsReq create() {
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName groupInfo = FieldName.forField("groupInfo", "group_info");
static final FieldName groupStateInfo = FieldName.forField("groupStateInfo", "group_state_info");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public static final class GroupStateChangeScNotify extends ProtoMessage<GroupSta
private static final long serialVersionUID = 0L;

/**
* <code>optional .GroupStateInfo group_info = 8;</code>
* <code>optional .GroupStateInfo group_state_info = 8;</code>
*/
private final GroupStateInfoOuterClass.GroupStateInfo groupInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
private final GroupStateInfoOuterClass.GroupStateInfo groupStateInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();

private GroupStateChangeScNotify() {
}
Expand All @@ -34,60 +34,60 @@ public static GroupStateChangeScNotify newInstance() {
}

/**
* <code>optional .GroupStateInfo group_info = 8;</code>
* @return whether the groupInfo field is set
* <code>optional .GroupStateInfo group_state_info = 8;</code>
* @return whether the groupStateInfo field is set
*/
public boolean hasGroupInfo() {
public boolean hasGroupStateInfo() {
return (bitField0_ & 0x00000001) != 0;
}

/**
* <code>optional .GroupStateInfo group_info = 8;</code>
* <code>optional .GroupStateInfo group_state_info = 8;</code>
* @return this
*/
public GroupStateChangeScNotify clearGroupInfo() {
public GroupStateChangeScNotify clearGroupStateInfo() {
bitField0_ &= ~0x00000001;
groupInfo.clear();
groupStateInfo.clear();
return this;
}

/**
* <code>optional .GroupStateInfo group_info = 8;</code>
* <code>optional .GroupStateInfo group_state_info = 8;</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 #getMutableGroupInfo()} if you want to modify it.
* Use {@link #getMutableGroupStateInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public GroupStateInfoOuterClass.GroupStateInfo getGroupInfo() {
return groupInfo;
public GroupStateInfoOuterClass.GroupStateInfo getGroupStateInfo() {
return groupStateInfo;
}

/**
* <code>optional .GroupStateInfo group_info = 8;</code>
* <code>optional .GroupStateInfo group_state_info = 8;</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 GroupStateInfoOuterClass.GroupStateInfo getMutableGroupInfo() {
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupStateInfo() {
bitField0_ |= 0x00000001;
return groupInfo;
return groupStateInfo;
}

/**
* <code>optional .GroupStateInfo group_info = 8;</code>
* @param value the groupInfo to set
* <code>optional .GroupStateInfo group_state_info = 8;</code>
* @param value the groupStateInfo to set
* @return this
*/
public GroupStateChangeScNotify setGroupInfo(
public GroupStateChangeScNotify setGroupStateInfo(
final GroupStateInfoOuterClass.GroupStateInfo value) {
bitField0_ |= 0x00000001;
groupInfo.copyFrom(value);
groupStateInfo.copyFrom(value);
return this;
}

Expand All @@ -96,7 +96,7 @@ public GroupStateChangeScNotify copyFrom(final GroupStateChangeScNotify other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
groupInfo.copyFrom(other.groupInfo);
groupStateInfo.copyFrom(other.groupStateInfo);
}
return this;
}
Expand All @@ -107,8 +107,8 @@ public GroupStateChangeScNotify mergeFrom(final GroupStateChangeScNotify other)
return this;
}
cachedSize = -1;
if (other.hasGroupInfo()) {
getMutableGroupInfo().mergeFrom(other.groupInfo);
if (other.hasGroupStateInfo()) {
getMutableGroupStateInfo().mergeFrom(other.groupStateInfo);
}
return this;
}
Expand All @@ -120,7 +120,7 @@ public GroupStateChangeScNotify clear() {
}
cachedSize = -1;
bitField0_ = 0;
groupInfo.clear();
groupStateInfo.clear();
return this;
}

Expand All @@ -131,7 +131,7 @@ public GroupStateChangeScNotify clearQuick() {
}
cachedSize = -1;
bitField0_ = 0;
groupInfo.clearQuick();
groupStateInfo.clearQuick();
return this;
}

Expand All @@ -145,22 +145,22 @@ public boolean equals(Object o) {
}
GroupStateChangeScNotify other = (GroupStateChangeScNotify) o;
return bitField0_ == other.bitField0_
&& (!hasGroupInfo() || groupInfo.equals(other.groupInfo));
&& (!hasGroupStateInfo() || groupStateInfo.equals(other.groupStateInfo));
}

@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 66);
output.writeMessageNoTag(groupInfo);
output.writeMessageNoTag(groupStateInfo);
}
}

@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(groupInfo);
size += 1 + ProtoSink.computeMessageSizeNoTag(groupStateInfo);
}
return size;
}
Expand All @@ -173,8 +173,8 @@ public GroupStateChangeScNotify mergeFrom(final ProtoSource input) throws IOExce
while (true) {
switch (tag) {
case 66: {
// groupInfo
input.readMessage(groupInfo);
// groupStateInfo
input.readMessage(groupStateInfo);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 0) {
Expand All @@ -199,7 +199,7 @@ public GroupStateChangeScNotify mergeFrom(final ProtoSource input) throws IOExce
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.groupInfo, groupInfo);
output.writeMessage(FieldNames.groupStateInfo, groupStateInfo);
}
output.endObject();
}
Expand All @@ -211,11 +211,11 @@ public GroupStateChangeScNotify mergeFrom(final JsonSource input) throws IOExcep
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -1483311155:
case 1282170478: {
if (input.isAtField(FieldNames.groupInfo)) {
case 1415312672:
case 1198732636: {
if (input.isAtField(FieldNames.groupStateInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(groupInfo);
input.readMessage(groupStateInfo);
bitField0_ |= 0x00000001;
}
} else {
Expand Down Expand Up @@ -276,7 +276,7 @@ public GroupStateChangeScNotify create() {
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName groupInfo = FieldName.forField("groupInfo", "group_info");
static final FieldName groupStateInfo = FieldName.forField("groupStateInfo", "group_state_info");
}
}
}
Loading

0 comments on commit 6b52f06

Please sign in to comment.