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
  • Method Details

    • getCode

      public long getCode()
       The HTTP response status code, such as `200` and `404`.
       
      int64 code = 1 [json_name = "code"];
      Specified by:
      getCode in interface AttributeContext.ResponseOrBuilder
      Returns:
      The code.
    • setCode

      public AttributeContext.Response.Builder setCode(long value)
       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:
      getSize in interface AttributeContext.ResponseOrBuilder
      Returns:
      The size.
    • setSize

      public AttributeContext.Response.Builder setSize(long value)
       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.ResponseOrBuilder
       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:
      getHeadersCount in interface AttributeContext.ResponseOrBuilder
    • containsHeaders

      public boolean containsHeaders(String key)
       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:
      containsHeaders in interface AttributeContext.ResponseOrBuilder
    • clearHeaders

      public AttributeContext.Response.Builder clearHeaders()
    • removeHeaders

      public AttributeContext.Response.Builder removeHeaders(String key)
       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 public Map<String,String> getHeaders()
      Deprecated.
      Use getHeadersMap() instead.
      Specified by:
      getHeaders in interface AttributeContext.ResponseOrBuilder
    • getHeadersMap

      public Map<String,String> 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:
      getHeadersMap in interface AttributeContext.ResponseOrBuilder
    • getHeadersOrDefault

      public String getHeadersOrDefault(String key, String defaultValue)
       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:
      getHeadersOrDefault in interface AttributeContext.ResponseOrBuilder
    • getHeadersOrThrow

      public String getHeadersOrThrow(String key)
       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:
      getHeadersOrThrow in interface AttributeContext.ResponseOrBuilder
    • putHeaders

      public AttributeContext.Response.Builder putHeaders(String key, String value)
       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

      public AttributeContext.Response.Builder putAllHeaders(Map<String,String> values)
       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:
      hasTime in interface AttributeContext.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:
      getTime in interface AttributeContext.ResponseOrBuilder
      Returns:
      The time.
    • setTime

      public AttributeContext.Response.Builder setTime(com.google.protobuf.Timestamp value)
       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

      public AttributeContext.Response.Builder mergeTime(com.google.protobuf.Timestamp value)
       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:
      hasBackendLatency in interface AttributeContext.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:
      getBackendLatency in interface AttributeContext.ResponseOrBuilder
      Returns:
      The backendLatency.
    • setBackendLatency

      public AttributeContext.Response.Builder setBackendLatency(com.google.protobuf.Duration value)
       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

      public AttributeContext.Response.Builder mergeBackendLatency(com.google.protobuf.Duration value)
       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

      public AttributeContext.Response.Builder 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"];