Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/rpc/http.proto
// Protobuf Java Version: 3.25.4
package com.google.rpc;
/**
*
* Represents an HTTP response.
*
*
* Protobuf type {@code google.rpc.HttpResponse}
*/
public final class HttpResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.rpc.HttpResponse)
HttpResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use HttpResponse.newBuilder() to construct.
private HttpResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private HttpResponse() {
reason_ = "";
headers_ = java.util.Collections.emptyList();
body_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new HttpResponse();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.rpc.HttpResponse.class, com.google.rpc.HttpResponse.Builder.class);
}
public static final int STATUS_FIELD_NUMBER = 1;
private int status_ = 0;
/**
*
* The HTTP status code, such as 200 or 404.
*
*
* int32 status = 1;
* @return The status.
*/
@java.lang.Override
public int getStatus() {
return status_;
}
public static final int REASON_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object reason_ = "";
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
* The HTTP response headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the response.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
@java.lang.Override
public com.google.rpc.HttpHeaderOrBuilder getHeadersOrBuilder(
int index) {
return headers_.get(index);
}
public static final int BODY_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* The HTTP response body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @return The body.
*/
@java.lang.Override
public com.google.protobuf.ByteString getBody() {
return body_;
}
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 (status_ != 0) {
output.writeInt32(1, status_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, reason_);
}
for (int i = 0; i < headers_.size(); i++) {
output.writeMessage(3, headers_.get(i));
}
if (!body_.isEmpty()) {
output.writeBytes(4, body_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (status_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, status_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, reason_);
}
for (int i = 0; i < headers_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, headers_.get(i));
}
if (!body_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, body_);
}
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 com.google.rpc.HttpResponse)) {
return super.equals(obj);
}
com.google.rpc.HttpResponse other = (com.google.rpc.HttpResponse) obj;
if (getStatus()
!= other.getStatus()) return false;
if (!getReason()
.equals(other.getReason())) return false;
if (!getHeadersList()
.equals(other.getHeadersList())) return false;
if (!getBody()
.equals(other.getBody())) 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) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + getStatus();
hash = (37 * hash) + REASON_FIELD_NUMBER;
hash = (53 * hash) + getReason().hashCode();
if (getHeadersCount() > 0) {
hash = (37 * hash) + HEADERS_FIELD_NUMBER;
hash = (53 * hash) + getHeadersList().hashCode();
}
hash = (37 * hash) + BODY_FIELD_NUMBER;
hash = (53 * hash) + getBody().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.rpc.HttpResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.rpc.HttpResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.rpc.HttpResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.rpc.HttpResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.rpc.HttpResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.rpc.HttpResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.rpc.HttpResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.rpc.HttpResponse 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 com.google.rpc.HttpResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.rpc.HttpResponse 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 com.google.rpc.HttpResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.rpc.HttpResponse 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(com.google.rpc.HttpResponse 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;
}
/**
*
* Represents an HTTP response.
*
*
* Protobuf type {@code google.rpc.HttpResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.rpc.HttpResponse)
com.google.rpc.HttpResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.rpc.HttpResponse.class, com.google.rpc.HttpResponse.Builder.class);
}
// Construct using com.google.rpc.HttpResponse.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
status_ = 0;
reason_ = "";
if (headersBuilder_ == null) {
headers_ = java.util.Collections.emptyList();
} else {
headers_ = null;
headersBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
body_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpResponse_descriptor;
}
@java.lang.Override
public com.google.rpc.HttpResponse getDefaultInstanceForType() {
return com.google.rpc.HttpResponse.getDefaultInstance();
}
@java.lang.Override
public com.google.rpc.HttpResponse build() {
com.google.rpc.HttpResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.rpc.HttpResponse buildPartial() {
com.google.rpc.HttpResponse result = new com.google.rpc.HttpResponse(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.rpc.HttpResponse result) {
if (headersBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
headers_ = java.util.Collections.unmodifiableList(headers_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.headers_ = headers_;
} else {
result.headers_ = headersBuilder_.build();
}
}
private void buildPartial0(com.google.rpc.HttpResponse result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.status_ = status_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.reason_ = reason_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.body_ = body_;
}
}
@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 com.google.rpc.HttpResponse) {
return mergeFrom((com.google.rpc.HttpResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.rpc.HttpResponse other) {
if (other == com.google.rpc.HttpResponse.getDefaultInstance()) return this;
if (other.getStatus() != 0) {
setStatus(other.getStatus());
}
if (!other.getReason().isEmpty()) {
reason_ = other.reason_;
bitField0_ |= 0x00000002;
onChanged();
}
if (headersBuilder_ == null) {
if (!other.headers_.isEmpty()) {
if (headers_.isEmpty()) {
headers_ = other.headers_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureHeadersIsMutable();
headers_.addAll(other.headers_);
}
onChanged();
}
} else {
if (!other.headers_.isEmpty()) {
if (headersBuilder_.isEmpty()) {
headersBuilder_.dispose();
headersBuilder_ = null;
headers_ = other.headers_;
bitField0_ = (bitField0_ & ~0x00000004);
headersBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getHeadersFieldBuilder() : null;
} else {
headersBuilder_.addAllMessages(other.headers_);
}
}
}
if (other.getBody() != com.google.protobuf.ByteString.EMPTY) {
setBody(other.getBody());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
status_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
reason_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26: {
com.google.rpc.HttpHeader m =
input.readMessage(
com.google.rpc.HttpHeader.parser(),
extensionRegistry);
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.add(m);
} else {
headersBuilder_.addMessage(m);
}
break;
} // case 26
case 34: {
body_ = input.readBytes();
bitField0_ |= 0x00000008;
break;
} // case 34
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int status_ ;
/**
*
* The HTTP status code, such as 200 or 404.
*
*
* int32 status = 1;
* @return The status.
*/
@java.lang.Override
public int getStatus() {
return status_;
}
/**
*
* The HTTP status code, such as 200 or 404.
*
*
* int32 status = 1;
* @param value The status to set.
* @return This builder for chaining.
*/
public Builder setStatus(int value) {
status_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The HTTP status code, such as 200 or 404.
*
*
* int32 status = 1;
* @return This builder for chaining.
*/
public Builder clearStatus() {
bitField0_ = (bitField0_ & ~0x00000001);
status_ = 0;
onChanged();
return this;
}
private java.lang.Object reason_ = "";
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
* The HTTP response body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @return The body.
*/
@java.lang.Override
public com.google.protobuf.ByteString getBody() {
return body_;
}
/**
*
* The HTTP response body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @param value The body to set.
* @return This builder for chaining.
*/
public Builder setBody(com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
body_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* The HTTP response body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @return This builder for chaining.
*/
public Builder clearBody() {
bitField0_ = (bitField0_ & ~0x00000008);
body_ = getDefaultInstance().getBody();
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:google.rpc.HttpResponse)
}
// @@protoc_insertion_point(class_scope:google.rpc.HttpResponse)
private static final com.google.rpc.HttpResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.rpc.HttpResponse();
}
public static com.google.rpc.HttpResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public HttpResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.rpc.HttpResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}