Package com.google.rpc.context
Class AttributeContext.Response.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<AttributeContext.Response,AttributeContext.Response.Builder>
com.google.rpc.context.AttributeContext.Response.Builder
- All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,AttributeContext.ResponseOrBuilder,Cloneable
- Enclosing class:
- AttributeContext.Response
public static final class AttributeContext.Response.Builder
extends com.google.protobuf.GeneratedMessageLite.Builder<AttributeContext.Response,AttributeContext.Response.Builder>
implements AttributeContext.ResponseOrBuilder
This message defines attributes for a typical network response. It generally models semantics of an HTTP response.Protobuf type
google.rpc.context.AttributeContext.Response-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescriptionThe amount of time it takes the backend service to fully respond to a request.The HTTP response status code, such as `200` and `404`.The HTTP response size in bytes.The timestamp when the `destination` service sends the last byte of the response.booleancontainsHeaders(String key) The HTTP response headers.com.google.protobuf.DurationThe amount of time it takes the backend service to fully respond to a request.longgetCode()The HTTP response status code, such as `200` and `404`.Deprecated.intThe HTTP response headers.The HTTP response headers.getHeadersOrDefault(String key, String defaultValue) The HTTP response headers.getHeadersOrThrow(String key) The HTTP response headers.longgetSize()The HTTP response size in bytes.com.google.protobuf.TimestampgetTime()The timestamp when the `destination` service sends the last byte of the response.booleanThe amount of time it takes the backend service to fully respond to a request.booleanhasTime()The timestamp when the `destination` service sends the last byte of the response.mergeBackendLatency(com.google.protobuf.Duration value) The amount of time it takes the backend service to fully respond to a request.mergeTime(com.google.protobuf.Timestamp value) The timestamp when the `destination` service sends the last byte of the response.putAllHeaders(Map<String, String> values) The HTTP response headers.putHeaders(String key, String value) The HTTP response headers.removeHeaders(String key) The HTTP response headers.setBackendLatency(com.google.protobuf.Duration value) The amount of time it takes the backend service to fully respond to a request.setBackendLatency(com.google.protobuf.Duration.Builder builderForValue) The amount of time it takes the backend service to fully respond to a request.setCode(long value) The HTTP response status code, such as `200` and `404`.setSize(long value) The HTTP response size in bytes.setTime(com.google.protobuf.Timestamp value) The timestamp when the `destination` service sends the last byte of the response.setTime(com.google.protobuf.Timestamp.Builder builderForValue) The timestamp when the `destination` service sends the last byte of the response.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Method Details
-
getCode
public long getCode()The HTTP response status code, such as `200` and `404`.
int64 code = 1 [json_name = "code"];- Specified by:
getCodein interfaceAttributeContext.ResponseOrBuilder- Returns:
- The code.
-
setCode
The HTTP response status code, such as `200` and `404`.
int64 code = 1 [json_name = "code"];- Parameters:
value- The code to set.- Returns:
- This builder for chaining.
-
clearCode
The HTTP response status code, such as `200` and `404`.
int64 code = 1 [json_name = "code"];- Returns:
- This builder for chaining.
-
getSize
public long getSize()The HTTP response size in bytes. If unknown, it must be -1.
int64 size = 2 [json_name = "size"];- Specified by:
getSizein interfaceAttributeContext.ResponseOrBuilder- Returns:
- The size.
-
setSize
The HTTP response size in bytes. If unknown, it must be -1.
int64 size = 2 [json_name = "size"];- Parameters:
value- The size to set.- Returns:
- This builder for chaining.
-
clearSize
The HTTP response size in bytes. If unknown, it must be -1.
int64 size = 2 [json_name = "size"];- Returns:
- This builder for chaining.
-
getHeadersCount
public int getHeadersCount()Description copied from interface:AttributeContext.ResponseOrBuilderThe HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"];- Specified by:
getHeadersCountin interfaceAttributeContext.ResponseOrBuilder
-
containsHeaders
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"];- Specified by:
containsHeadersin interfaceAttributeContext.ResponseOrBuilder
-
clearHeaders
-
removeHeaders
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"]; -
getHeaders
Deprecated.UsegetHeadersMap()instead.- Specified by:
getHeadersin interfaceAttributeContext.ResponseOrBuilder
-
getHeadersMap
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"];- Specified by:
getHeadersMapin interfaceAttributeContext.ResponseOrBuilder
-
getHeadersOrDefault
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"];- Specified by:
getHeadersOrDefaultin interfaceAttributeContext.ResponseOrBuilder
-
getHeadersOrThrow
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"];- Specified by:
getHeadersOrThrowin interfaceAttributeContext.ResponseOrBuilder
-
putHeaders
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"]; -
putAllHeaders
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3 [json_name = "headers"]; -
hasTime
public boolean hasTime()The timestamp when the `destination` service sends the last byte of the response.
.google.protobuf.Timestamp time = 4 [json_name = "time"];- Specified by:
hasTimein interfaceAttributeContext.ResponseOrBuilder- Returns:
- Whether the time field is set.
-
getTime
public com.google.protobuf.Timestamp getTime()The timestamp when the `destination` service sends the last byte of the response.
.google.protobuf.Timestamp time = 4 [json_name = "time"];- Specified by:
getTimein interfaceAttributeContext.ResponseOrBuilder- Returns:
- The time.
-
setTime
The timestamp when the `destination` service sends the last byte of the response.
.google.protobuf.Timestamp time = 4 [json_name = "time"]; -
setTime
public AttributeContext.Response.Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) The timestamp when the `destination` service sends the last byte of the response.
.google.protobuf.Timestamp time = 4 [json_name = "time"]; -
mergeTime
The timestamp when the `destination` service sends the last byte of the response.
.google.protobuf.Timestamp time = 4 [json_name = "time"]; -
clearTime
The timestamp when the `destination` service sends the last byte of the response.
.google.protobuf.Timestamp time = 4 [json_name = "time"]; -
hasBackendLatency
public boolean hasBackendLatency()The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
.google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"];- Specified by:
hasBackendLatencyin interfaceAttributeContext.ResponseOrBuilder- Returns:
- Whether the backendLatency field is set.
-
getBackendLatency
public com.google.protobuf.Duration getBackendLatency()The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
.google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"];- Specified by:
getBackendLatencyin interfaceAttributeContext.ResponseOrBuilder- Returns:
- The backendLatency.
-
setBackendLatency
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
.google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"]; -
setBackendLatency
public AttributeContext.Response.Builder setBackendLatency(com.google.protobuf.Duration.Builder builderForValue) The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
.google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"]; -
mergeBackendLatency
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
.google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"]; -
clearBackendLatency
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
.google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"];
-