int64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return The id.
+ */
+ @java.lang.Override
+ public long getId() {
+ return id_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (id_ != 0L) {
+ output.writeInt64(1, id_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (id_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, id_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof user.v1.DeleteUserRequest)) {
+ return super.equals(obj);
+ }
+ user.v1.DeleteUserRequest other = (user.v1.DeleteUserRequest) obj;
+
+ if (getId()
+ != other.getId()) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getId());
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static user.v1.DeleteUserRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public static user.v1.DeleteUserRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static user.v1.DeleteUserRequest parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.DeleteUserRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(user.v1.DeleteUserRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code user.v1.DeleteUserRequest}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builderint64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return The id.
+ */
+ @java.lang.Override
+ public long getId() {
+ return id_;
+ }
+ /**
+ * int64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @param value The id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setId(long value) {
+
+ id_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return This builder for chaining.
+ */
+ public Builder clearId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ id_ = 0L;
+ 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:user.v1.DeleteUserRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:user.v1.DeleteUserRequest)
+ private static final user.v1.DeleteUserRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new user.v1.DeleteUserRequest();
+ }
+
+ public static user.v1.DeleteUserRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserint64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return The id.
+ */
+ long getId();
+}
diff --git a/examples/transcoding/best-practice/bp-api/generated/java/user/v1/DeleteUserResponse.java b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/DeleteUserResponse.java
new file mode 100644
index 0000000..21f8ff1
--- /dev/null
+++ b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/DeleteUserResponse.java
@@ -0,0 +1,399 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: user/v1/user.proto
+
+// Protobuf Java Version: 3.25.1
+package user.v1;
+
+/**
+ * Protobuf type {@code user.v1.DeleteUserResponse}
+ */
+public final class DeleteUserResponse extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:user.v1.DeleteUserResponse)
+ DeleteUserResponseOrBuilder {
+private static final long serialVersionUID = 0L;
+ // Use DeleteUserResponse.newBuilder() to construct.
+ private DeleteUserResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private DeleteUserResponse() {
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new DeleteUserResponse();
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return user.v1.UserOuterClass.internal_static_user_v1_DeleteUserResponse_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return user.v1.UserOuterClass.internal_static_user_v1_DeleteUserResponse_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ user.v1.DeleteUserResponse.class, user.v1.DeleteUserResponse.Builder.class);
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof user.v1.DeleteUserResponse)) {
+ return super.equals(obj);
+ }
+ user.v1.DeleteUserResponse other = (user.v1.DeleteUserResponse) obj;
+
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static user.v1.DeleteUserResponse parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public static user.v1.DeleteUserResponse parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static user.v1.DeleteUserResponse parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.DeleteUserResponse parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(user.v1.DeleteUserResponse prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code user.v1.DeleteUserResponse}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builderint64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return The id.
+ */
+ @java.lang.Override
+ public long getId() {
+ return id_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (id_ != 0L) {
+ output.writeInt64(1, id_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (id_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, id_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof user.v1.GetUserRequest)) {
+ return super.equals(obj);
+ }
+ user.v1.GetUserRequest other = (user.v1.GetUserRequest) obj;
+
+ if (getId()
+ != other.getId()) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getId());
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static user.v1.GetUserRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.GetUserRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.GetUserRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public static user.v1.GetUserRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static user.v1.GetUserRequest parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.GetUserRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(user.v1.GetUserRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code user.v1.GetUserRequest}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builderint64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return The id.
+ */
+ @java.lang.Override
+ public long getId() {
+ return id_;
+ }
+ /**
+ * int64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @param value The id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setId(long value) {
+
+ id_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return This builder for chaining.
+ */
+ public Builder clearId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ id_ = 0L;
+ 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:user.v1.GetUserRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:user.v1.GetUserRequest)
+ private static final user.v1.GetUserRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new user.v1.GetUserRequest();
+ }
+
+ public static user.v1.GetUserRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserint64 id = 1 [json_name = "id", (.buf.validate.field) = { ... }
+ * @return The id.
+ */
+ long getId();
+}
diff --git a/examples/transcoding/best-practice/bp-api/generated/java/user/v1/GetUserResponse.java b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/GetUserResponse.java
new file mode 100644
index 0000000..68f9cab
--- /dev/null
+++ b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/GetUserResponse.java
@@ -0,0 +1,599 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: user/v1/user.proto
+
+// Protobuf Java Version: 3.25.1
+package user.v1;
+
+/**
+ * Protobuf type {@code user.v1.GetUserResponse}
+ */
+public final class GetUserResponse extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:user.v1.GetUserResponse)
+ GetUserResponseOrBuilder {
+private static final long serialVersionUID = 0L;
+ // Use GetUserResponse.newBuilder() to construct.
+ private GetUserResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private GetUserResponse() {
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new GetUserResponse();
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return user.v1.UserOuterClass.internal_static_user_v1_GetUserResponse_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return user.v1.UserOuterClass.internal_static_user_v1_GetUserResponse_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ user.v1.GetUserResponse.class, user.v1.GetUserResponse.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int USER_FIELD_NUMBER = 1;
+ private user.v1.User user_;
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ * @return Whether the user field is set.
+ */
+ @java.lang.Override
+ public boolean hasUser() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ * @return The user.
+ */
+ @java.lang.Override
+ public user.v1.User getUser() {
+ return user_ == null ? user.v1.User.getDefaultInstance() : user_;
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ @java.lang.Override
+ public user.v1.UserOrBuilder getUserOrBuilder() {
+ return user_ == null ? user.v1.User.getDefaultInstance() : user_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeMessage(1, getUser());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getUser());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof user.v1.GetUserResponse)) {
+ return super.equals(obj);
+ }
+ user.v1.GetUserResponse other = (user.v1.GetUserResponse) obj;
+
+ if (hasUser() != other.hasUser()) return false;
+ if (hasUser()) {
+ if (!getUser()
+ .equals(other.getUser())) return false;
+ }
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasUser()) {
+ hash = (37 * hash) + USER_FIELD_NUMBER;
+ hash = (53 * hash) + getUser().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static user.v1.GetUserResponse parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.GetUserResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.GetUserResponse parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public static user.v1.GetUserResponse parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static user.v1.GetUserResponse parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.GetUserResponse parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(user.v1.GetUserResponse prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code user.v1.GetUserResponse}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder.user.v1.User user = 1 [json_name = "user"];
+ * @return Whether the user field is set.
+ */
+ public boolean hasUser() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ * @return The user.
+ */
+ public user.v1.User getUser() {
+ if (userBuilder_ == null) {
+ return user_ == null ? user.v1.User.getDefaultInstance() : user_;
+ } else {
+ return userBuilder_.getMessage();
+ }
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ public Builder setUser(user.v1.User value) {
+ if (userBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ user_ = value;
+ } else {
+ userBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ public Builder setUser(
+ user.v1.User.Builder builderForValue) {
+ if (userBuilder_ == null) {
+ user_ = builderForValue.build();
+ } else {
+ userBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ public Builder mergeUser(user.v1.User value) {
+ if (userBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) != 0) &&
+ user_ != null &&
+ user_ != user.v1.User.getDefaultInstance()) {
+ getUserBuilder().mergeFrom(value);
+ } else {
+ user_ = value;
+ }
+ } else {
+ userBuilder_.mergeFrom(value);
+ }
+ if (user_ != null) {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ }
+ return this;
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ public Builder clearUser() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ user_ = null;
+ if (userBuilder_ != null) {
+ userBuilder_.dispose();
+ userBuilder_ = null;
+ }
+ onChanged();
+ return this;
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ public user.v1.User.Builder getUserBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getUserFieldBuilder().getBuilder();
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ public user.v1.UserOrBuilder getUserOrBuilder() {
+ if (userBuilder_ != null) {
+ return userBuilder_.getMessageOrBuilder();
+ } else {
+ return user_ == null ?
+ user.v1.User.getDefaultInstance() : user_;
+ }
+ }
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ user.v1.User, user.v1.User.Builder, user.v1.UserOrBuilder>
+ getUserFieldBuilder() {
+ if (userBuilder_ == null) {
+ userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ user.v1.User, user.v1.User.Builder, user.v1.UserOrBuilder>(
+ getUser(),
+ getParentForChildren(),
+ isClean());
+ user_ = null;
+ }
+ return userBuilder_;
+ }
+ @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:user.v1.GetUserResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:user.v1.GetUserResponse)
+ private static final user.v1.GetUserResponse DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new user.v1.GetUserResponse();
+ }
+
+ public static user.v1.GetUserResponse getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser.user.v1.User user = 1 [json_name = "user"];
+ * @return Whether the user field is set.
+ */
+ boolean hasUser();
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ * @return The user.
+ */
+ user.v1.User getUser();
+ /**
+ * .user.v1.User user = 1 [json_name = "user"];
+ */
+ user.v1.UserOrBuilder getUserOrBuilder();
+}
diff --git a/examples/transcoding/best-practice/bp-api/generated/java/user/v1/User.java b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/User.java
new file mode 100644
index 0000000..93b374a
--- /dev/null
+++ b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/User.java
@@ -0,0 +1,609 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: user/v1/user.proto
+
+// Protobuf Java Version: 3.25.1
+package user.v1;
+
+/**
+ * Protobuf type {@code user.v1.User}
+ */
+public final class User extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:user.v1.User)
+ UserOrBuilder {
+private static final long serialVersionUID = 0L;
+ // Use User.newBuilder() to construct.
+ private User(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private User() {
+ name_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new User();
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return user.v1.UserOuterClass.internal_static_user_v1_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return user.v1.UserOuterClass.internal_static_user_v1_User_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ user.v1.User.class, user.v1.User.Builder.class);
+ }
+
+ public static final int ID_FIELD_NUMBER = 1;
+ private long id_ = 0L;
+ /**
+ * int64 id = 1 [json_name = "id"];
+ * @return The id.
+ */
+ @java.lang.Override
+ public long getId() {
+ return id_;
+ }
+
+ public static final int NAME_FIELD_NUMBER = 2;
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object name_ = "";
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return The name.
+ */
+ @java.lang.Override
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ }
+ }
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (id_ != 0L) {
+ output.writeInt64(1, id_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (id_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, id_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof user.v1.User)) {
+ return super.equals(obj);
+ }
+ user.v1.User other = (user.v1.User) obj;
+
+ if (getId()
+ != other.getId()) return false;
+ if (!getName()
+ .equals(other.getName())) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getId());
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static user.v1.User parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.User parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.User parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.User parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.User parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static user.v1.User parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static user.v1.User parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.User parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public static user.v1.User parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static user.v1.User parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static user.v1.User parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static user.v1.User parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(user.v1.User prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code user.v1.User}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builderint64 id = 1 [json_name = "id"];
+ * @return The id.
+ */
+ @java.lang.Override
+ public long getId() {
+ return id_;
+ }
+ /**
+ * int64 id = 1 [json_name = "id"];
+ * @param value The id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setId(long value) {
+
+ id_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 id = 1 [json_name = "id"];
+ * @return This builder for chaining.
+ */
+ public Builder clearId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ id_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object name_ = "";
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return The name.
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return The bytes for name.
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string name = 2 [json_name = "name"];
+ * @param value The name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setName(
+ java.lang.String value) {
+ if (value == null) { throw new NullPointerException(); }
+ name_ = value;
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return This builder for chaining.
+ */
+ public Builder clearName() {
+ name_ = getDefaultInstance().getName();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+ /**
+ * string name = 2 [json_name = "name"];
+ * @param value The bytes for name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) { throw new NullPointerException(); }
+ checkByteStringIsUtf8(value);
+ name_ = value;
+ bitField0_ |= 0x00000002;
+ 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:user.v1.User)
+ }
+
+ // @@protoc_insertion_point(class_scope:user.v1.User)
+ private static final user.v1.User DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new user.v1.User();
+ }
+
+ public static user.v1.User getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserint64 id = 1 [json_name = "id"];
+ * @return The id.
+ */
+ long getId();
+
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return The name.
+ */
+ java.lang.String getName();
+ /**
+ * string name = 2 [json_name = "name"];
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString
+ getNameBytes();
+}
diff --git a/examples/transcoding/best-practice/bp-api/generated/java/user/v1/UserOuterClass.java b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/UserOuterClass.java
new file mode 100644
index 0000000..9e5de7e
--- /dev/null
+++ b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/UserOuterClass.java
@@ -0,0 +1,114 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: user/v1/user.proto
+
+// Protobuf Java Version: 3.25.1
+package user.v1;
+
+public final class UserOuterClass {
+ private UserOuterClass() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions(
+ (com.google.protobuf.ExtensionRegistryLite) registry);
+ }
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_user_v1_User_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_user_v1_User_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_user_v1_GetUserRequest_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_user_v1_GetUserRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_user_v1_GetUserResponse_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_user_v1_GetUserResponse_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_user_v1_DeleteUserRequest_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_user_v1_DeleteUserRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_user_v1_DeleteUserResponse_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_user_v1_DeleteUserResponse_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor
+ getDescriptor() {
+ return descriptor;
+ }
+ private static com.google.protobuf.Descriptors.FileDescriptor
+ descriptor;
+ static {
+ java.lang.String[] descriptorData = {
+ "\n\022user/v1/user.proto\022\007user.v1\032\034google/ap" +
+ "i/annotations.proto\032\033buf/validate/valida" +
+ "te.proto\"*\n\004User\022\016\n\002id\030\001 \001(\003R\002id\022\022\n\004name" +
+ "\030\002 \001(\tR\004name\")\n\016GetUserRequest\022\027\n\002id\030\001 \001" +
+ "(\003B\007\272H\004\"\002(\000R\002id\"4\n\017GetUserResponse\022!\n\004us" +
+ "er\030\001 \001(\0132\r.user.v1.UserR\004user\",\n\021DeleteU" +
+ "serRequest\022\027\n\002id\030\001 \001(\003B\007\272H\004\"\002(\000R\002id\"\024\n\022D" +
+ "eleteUserResponse2\302\001\n\013UserService\022T\n\007Get" +
+ "User\022\027.user.v1.GetUserRequest\032\030.user.v1." +
+ "GetUserResponse\"\026\202\323\344\223\002\020\022\016/v1/users/{id}\022" +
+ "]\n\nDeleteUser\022\032.user.v1.DeleteUserReques" +
+ "t\032\033.user.v1.DeleteUserResponse\"\026\202\323\344\223\002\020*\016" +
+ "/v1/users/{id}B(P\001Z$github.com/your/repo" +
+ "/user/v1;user_v1b\006proto3"
+ };
+ descriptor = com.google.protobuf.Descriptors.FileDescriptor
+ .internalBuildGeneratedFileFrom(descriptorData,
+ new com.google.protobuf.Descriptors.FileDescriptor[] {
+ com.google.api.AnnotationsProto.getDescriptor(),
+ build.buf.validate.ValidateProto.getDescriptor(),
+ });
+ internal_static_user_v1_User_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_user_v1_User_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_user_v1_User_descriptor,
+ new java.lang.String[] { "Id", "Name", });
+ internal_static_user_v1_GetUserRequest_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_user_v1_GetUserRequest_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_user_v1_GetUserRequest_descriptor,
+ new java.lang.String[] { "Id", });
+ internal_static_user_v1_GetUserResponse_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_user_v1_GetUserResponse_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_user_v1_GetUserResponse_descriptor,
+ new java.lang.String[] { "User", });
+ internal_static_user_v1_DeleteUserRequest_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_user_v1_DeleteUserRequest_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_user_v1_DeleteUserRequest_descriptor,
+ new java.lang.String[] { "Id", });
+ internal_static_user_v1_DeleteUserResponse_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_user_v1_DeleteUserResponse_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_user_v1_DeleteUserResponse_descriptor,
+ new java.lang.String[] { });
+ com.google.protobuf.ExtensionRegistry registry =
+ com.google.protobuf.ExtensionRegistry.newInstance();
+ registry.add(build.buf.validate.ValidateProto.field);
+ registry.add(com.google.api.AnnotationsProto.http);
+ com.google.protobuf.Descriptors.FileDescriptor
+ .internalUpdateFileDescriptor(descriptor, registry);
+ com.google.api.AnnotationsProto.getDescriptor();
+ build.buf.validate.ValidateProto.getDescriptor();
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/examples/transcoding/best-practice/bp-api/generated/java/user/v1/UserServiceGrpc.java b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/UserServiceGrpc.java
new file mode 100644
index 0000000..72ed925
--- /dev/null
+++ b/examples/transcoding/best-practice/bp-api/generated/java/user/v1/UserServiceGrpc.java
@@ -0,0 +1,391 @@
+package user.v1;
+
+import static io.grpc.MethodDescriptor.generateFullMethodName;
+
+/**
+ */
+@javax.annotation.Generated(
+ value = "by gRPC proto compiler (version 1.64.0)",
+ comments = "Source: user/v1/user.proto")
+@io.grpc.stub.annotations.GrpcGenerated
+public final class UserServiceGrpc {
+
+ private UserServiceGrpc() {}
+
+ public static final java.lang.String SERVICE_NAME = "user.v1.UserService";
+
+ // Static method descriptors that strictly reflect the proto.
+ private static volatile io.grpc.MethodDescriptor+ * Get a user by ID. + *+ */ + default void getUser(user.v1.GetUserRequest request, + io.grpc.stub.StreamObserver
+ * Delete a user by ID. + *+ */ + default void deleteUser(user.v1.DeleteUserRequest request, + io.grpc.stub.StreamObserver
+ * Get a user by ID. + *+ */ + public void getUser(user.v1.GetUserRequest request, + io.grpc.stub.StreamObserver
+ * Delete a user by ID. + *+ */ + public void deleteUser(user.v1.DeleteUserRequest request, + io.grpc.stub.StreamObserver
+ * Get a user by ID. + *+ */ + public user.v1.GetUserResponse getUser(user.v1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + *
+ * Delete a user by ID. + *+ */ + public user.v1.DeleteUserResponse deleteUser(user.v1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service UserService. + */ + public static final class UserServiceFutureStub + extends io.grpc.stub.AbstractFutureStub
+ * Get a user by ID. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Delete a user by ID. + *+ */ + public com.google.common.util.concurrent.ListenableFuture