com.google.rpc.HttpResponse Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: google/rpc/http.proto
// Protobuf Java Version: 4.28.1
package com.google.rpc;
/**
*
* Represents an HTTP response.
*
*
* Protobuf type {@code google.rpc.HttpResponse}
*/
public final class HttpResponse extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:google.rpc.HttpResponse)
HttpResponseOrBuilder {
private static final long serialVersionUID = 0L;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 28,
/* patch= */ 1,
/* suffix= */ "",
HttpResponse.class.getName());
}
// Use HttpResponse.newBuilder() to construct.
private HttpResponse(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private HttpResponse() {
reason_ = "";
headers_ = java.util.Collections.emptyList();
body_ = com.google.protobuf.ByteString.EMPTY;
}
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.GeneratedMessage.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".
*
*
* string reason = 2;
* @return The reason.
*/
@java.lang.Override
public java.lang.String getReason() {
java.lang.Object ref = reason_;
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();
reason_ = s;
return s;
}
}
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
*
* string reason = 2;
* @return The bytes for reason.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getReasonBytes() {
java.lang.Object ref = reason_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
reason_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HEADERS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List headers_;
/**
*
* 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 java.util.List getHeadersList() {
return headers_;
}
/**
*
* 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 java.util.List extends com.google.rpc.HttpHeaderOrBuilder>
getHeadersOrBuilderList() {
return headers_;
}
/**
*
* 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 int getHeadersCount() {
return headers_.size();
}
/**
*
* 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.HttpHeader getHeaders(int index) {
return headers_.get(index);
}
/**
*
* 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.GeneratedMessage.isStringEmpty(reason_)) {
com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(reason_)) {
size += com.google.protobuf.GeneratedMessage.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.GeneratedMessage
.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.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.rpc.HttpResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.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.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.rpc.HttpResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.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.GeneratedMessage
.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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 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.GeneratedMessage.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".
*
*
* string reason = 2;
* @return The reason.
*/
public java.lang.String getReason() {
java.lang.Object ref = reason_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
reason_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
*
* string reason = 2;
* @return The bytes for reason.
*/
public com.google.protobuf.ByteString
getReasonBytes() {
java.lang.Object ref = reason_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
reason_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
*
* string reason = 2;
* @param value The reason to set.
* @return This builder for chaining.
*/
public Builder setReason(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
reason_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
*
* string reason = 2;
* @return This builder for chaining.
*/
public Builder clearReason() {
reason_ = getDefaultInstance().getReason();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
* The HTTP reason phrase, such as "OK" or "Not Found".
*
*
* string reason = 2;
* @param value The bytes for reason to set.
* @return This builder for chaining.
*/
public Builder setReasonBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
reason_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.util.List headers_ =
java.util.Collections.emptyList();
private void ensureHeadersIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
headers_ = new java.util.ArrayList(headers_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.rpc.HttpHeader, com.google.rpc.HttpHeader.Builder, com.google.rpc.HttpHeaderOrBuilder> headersBuilder_;
/**
*
* 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;
*/
public java.util.List getHeadersList() {
if (headersBuilder_ == null) {
return java.util.Collections.unmodifiableList(headers_);
} else {
return headersBuilder_.getMessageList();
}
}
/**
*
* 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;
*/
public int getHeadersCount() {
if (headersBuilder_ == null) {
return headers_.size();
} else {
return headersBuilder_.getCount();
}
}
/**
*
* 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;
*/
public com.google.rpc.HttpHeader getHeaders(int index) {
if (headersBuilder_ == null) {
return headers_.get(index);
} else {
return headersBuilder_.getMessage(index);
}
}
/**
*
* 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;
*/
public Builder setHeaders(
int index, com.google.rpc.HttpHeader value) {
if (headersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHeadersIsMutable();
headers_.set(index, value);
onChanged();
} else {
headersBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* 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;
*/
public Builder setHeaders(
int index, com.google.rpc.HttpHeader.Builder builderForValue) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.set(index, builderForValue.build());
onChanged();
} else {
headersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* 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;
*/
public Builder addHeaders(com.google.rpc.HttpHeader value) {
if (headersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHeadersIsMutable();
headers_.add(value);
onChanged();
} else {
headersBuilder_.addMessage(value);
}
return this;
}
/**
*
* 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;
*/
public Builder addHeaders(
int index, com.google.rpc.HttpHeader value) {
if (headersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHeadersIsMutable();
headers_.add(index, value);
onChanged();
} else {
headersBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* 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;
*/
public Builder addHeaders(
com.google.rpc.HttpHeader.Builder builderForValue) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.add(builderForValue.build());
onChanged();
} else {
headersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* 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;
*/
public Builder addHeaders(
int index, com.google.rpc.HttpHeader.Builder builderForValue) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.add(index, builderForValue.build());
onChanged();
} else {
headersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* 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;
*/
public Builder addAllHeaders(
java.lang.Iterable extends com.google.rpc.HttpHeader> values) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, headers_);
onChanged();
} else {
headersBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* 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;
*/
public Builder clearHeaders() {
if (headersBuilder_ == null) {
headers_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
headersBuilder_.clear();
}
return this;
}
/**
*
* 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;
*/
public Builder removeHeaders(int index) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.remove(index);
onChanged();
} else {
headersBuilder_.remove(index);
}
return this;
}
/**
*
* 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;
*/
public com.google.rpc.HttpHeader.Builder getHeadersBuilder(
int index) {
return getHeadersFieldBuilder().getBuilder(index);
}
/**
*
* 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;
*/
public com.google.rpc.HttpHeaderOrBuilder getHeadersOrBuilder(
int index) {
if (headersBuilder_ == null) {
return headers_.get(index); } else {
return headersBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* 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;
*/
public java.util.List extends com.google.rpc.HttpHeaderOrBuilder>
getHeadersOrBuilderList() {
if (headersBuilder_ != null) {
return headersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(headers_);
}
}
/**
*
* 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;
*/
public com.google.rpc.HttpHeader.Builder addHeadersBuilder() {
return getHeadersFieldBuilder().addBuilder(
com.google.rpc.HttpHeader.getDefaultInstance());
}
/**
*
* 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;
*/
public com.google.rpc.HttpHeader.Builder addHeadersBuilder(
int index) {
return getHeadersFieldBuilder().addBuilder(
index, com.google.rpc.HttpHeader.getDefaultInstance());
}
/**
*
* 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;
*/
public java.util.List
getHeadersBuilderList() {
return getHeadersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.rpc.HttpHeader, com.google.rpc.HttpHeader.Builder, com.google.rpc.HttpHeaderOrBuilder>
getHeadersFieldBuilder() {
if (headersBuilder_ == null) {
headersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.google.rpc.HttpHeader, com.google.rpc.HttpHeader.Builder, com.google.rpc.HttpHeaderOrBuilder>(
headers_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
headers_ = null;
}
return headersBuilder_;
}
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_;
}
/**
*
* 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;
}
// @@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;
}
}