Skip to content

Commit

Permalink
chore: Revert StateProto generation to use protobuf v25.4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpri10 committed Aug 29, 2024
1 parent e72ee08 commit f7efd14
Showing 1 changed file with 85 additions and 44 deletions.
129 changes: 85 additions & 44 deletions samples/snippets/src/main/java/utilities/StateProto.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
* limitations under the License.
*/

/**
* This file is created using protoc.
*
* <p>To download, visit https://developers.google.com/protocol-buffers/docs/downloads
*
* <p>Run the following command from the `samples/snippets` directory to generate this class:
*
* <p>`protoc --proto_path=src/main/resources/ --java_out=src/main/java/
* src/main/resources/us-states.proto`
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: us-states.proto
// Protobuf Java Version: 4.27.4

// Protobuf Java Version: 3.25.4
package utilities;

public final class StateProto {
private StateProto() {}
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 27,
/* patch= */ 4,
/* suffix= */ "",
StateProto.class.getName());
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
Expand Down Expand Up @@ -73,35 +73,33 @@ public interface StateOrBuilder extends
* Protobuf type {@code utilities.State}
*/
public static final class State extends
com.google.protobuf.GeneratedMessage implements
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:utilities.State)
StateOrBuilder {
private static final long serialVersionUID = 0L;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 27,
/* patch= */ 4,
/* suffix= */ "",
State.class.getName());
}
// Use State.newBuilder() to construct.
private State(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
private State(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private State() {
name_ = "";
postAbbr_ = "";
}

@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new State();
}

public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return utilities.StateProto.internal_static_utilities_State_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return utilities.StateProto.internal_static_utilities_State_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Expand Down Expand Up @@ -200,11 +198,11 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(postAbbr_)) {
com.google.protobuf.GeneratedMessage.writeString(output, 2, postAbbr_);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postAbbr_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, postAbbr_);
}
getUnknownFields().writeTo(output);
}
Expand All @@ -215,11 +213,11 @@ public int getSerializedSize() {
if (size != -1) return size;

size = 0;
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(postAbbr_)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, postAbbr_);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postAbbr_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, postAbbr_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
Expand Down Expand Up @@ -294,41 +292,41 @@ public static utilities.StateProto.State parseFrom(
}
public static utilities.StateProto.State parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static utilities.StateProto.State parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}

public static utilities.StateProto.State parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}

public static utilities.StateProto.State parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static utilities.StateProto.State parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static utilities.StateProto.State parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}

Expand All @@ -348,15 +346,15 @@ public Builder toBuilder() {

@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code utilities.State}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:utilities.State)
utilities.StateProto.StateOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
Expand All @@ -365,7 +363,7 @@ public static final class Builder extends
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return utilities.StateProto.internal_static_utilities_State_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Expand All @@ -378,7 +376,7 @@ private Builder() {
}

private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);

}
Expand Down Expand Up @@ -429,6 +427,38 @@ private void buildPartial0(utilities.StateProto.State result) {
}
}

@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof utilities.StateProto.State) {
Expand Down Expand Up @@ -647,6 +677,18 @@ public Builder setPostAbbrBytes(
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}

@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}


// @@protoc_insertion_point(builder_scope:utilities.State)
}
Expand Down Expand Up @@ -702,7 +744,7 @@ public utilities.StateProto.State getDefaultInstanceForType() {
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_utilities_State_descriptor;
private static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_utilities_State_fieldAccessorTable;

public static com.google.protobuf.Descriptors.FileDescriptor
Expand All @@ -724,10 +766,9 @@ public utilities.StateProto.State getDefaultInstanceForType() {
internal_static_utilities_State_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_utilities_State_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_utilities_State_descriptor,
new java.lang.String[] { "Name", "PostAbbr", });
descriptor.resolveAllFeaturesImmutable();
}

// @@protoc_insertion_point(outer_class_scope)
Expand Down

0 comments on commit f7efd14

Please sign in to comment.