Class AttributeContext.Peer.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<AttributeContext.Peer,AttributeContext.Peer.Builder>
com.google.rpc.context.AttributeContext.Peer.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, AttributeContext.PeerOrBuilder, Cloneable
Enclosing class:
AttributeContext.Peer

public static final class AttributeContext.Peer.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<AttributeContext.Peer,AttributeContext.Peer.Builder> implements AttributeContext.PeerOrBuilder
 This message defines attributes for a node that handles a network request.
 The node can be either a service or an application that sends, forwards,
 or receives the request. Service peers should fill in
 `principal` and `labels` as appropriate.
 
Protobuf type google.rpc.context.AttributeContext.Peer
  • Method Details

    • getIp

      public String getIp()
       The IP address of the peer.
       
      string ip = 1 [json_name = "ip"];
      Specified by:
      getIp in interface AttributeContext.PeerOrBuilder
      Returns:
      The ip.
    • getIpBytes

      public com.google.protobuf.ByteString getIpBytes()
       The IP address of the peer.
       
      string ip = 1 [json_name = "ip"];
      Specified by:
      getIpBytes in interface AttributeContext.PeerOrBuilder
      Returns:
      The bytes for ip.
    • setIp

      public AttributeContext.Peer.Builder setIp(String value)
       The IP address of the peer.
       
      string ip = 1 [json_name = "ip"];
      Parameters:
      value - The ip to set.
      Returns:
      This builder for chaining.
    • clearIp

       The IP address of the peer.
       
      string ip = 1 [json_name = "ip"];
      Returns:
      This builder for chaining.
    • setIpBytes

      public AttributeContext.Peer.Builder setIpBytes(com.google.protobuf.ByteString value)
       The IP address of the peer.
       
      string ip = 1 [json_name = "ip"];
      Parameters:
      value - The bytes for ip to set.
      Returns:
      This builder for chaining.
    • getPort

      public long getPort()
       The network port of the peer.
       
      int64 port = 2 [json_name = "port"];
      Specified by:
      getPort in interface AttributeContext.PeerOrBuilder
      Returns:
      The port.
    • setPort

      public AttributeContext.Peer.Builder setPort(long value)
       The network port of the peer.
       
      int64 port = 2 [json_name = "port"];
      Parameters:
      value - The port to set.
      Returns:
      This builder for chaining.
    • clearPort

      public AttributeContext.Peer.Builder clearPort()
       The network port of the peer.
       
      int64 port = 2 [json_name = "port"];
      Returns:
      This builder for chaining.
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: AttributeContext.PeerOrBuilder
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
      Specified by:
      getLabelsCount in interface AttributeContext.PeerOrBuilder
    • containsLabels

      public boolean containsLabels(String key)
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
      Specified by:
      containsLabels in interface AttributeContext.PeerOrBuilder
    • clearLabels

      public AttributeContext.Peer.Builder clearLabels()
    • removeLabels

      public AttributeContext.Peer.Builder removeLabels(String key)
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface AttributeContext.PeerOrBuilder
    • getLabelsMap

      public Map<String,String> getLabelsMap()
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
      Specified by:
      getLabelsMap in interface AttributeContext.PeerOrBuilder
    • getLabelsOrDefault

      public String getLabelsOrDefault(String key, String defaultValue)
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
      Specified by:
      getLabelsOrDefault in interface AttributeContext.PeerOrBuilder
    • getLabelsOrThrow

      public String getLabelsOrThrow(String key)
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
      Specified by:
      getLabelsOrThrow in interface AttributeContext.PeerOrBuilder
    • putLabels

      public AttributeContext.Peer.Builder putLabels(String key, String value)
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
    • putAllLabels

      public AttributeContext.Peer.Builder putAllLabels(Map<String,String> values)
       The labels associated with the peer.
       
      map<string, string> labels = 6 [json_name = "labels"];
    • getPrincipal

      public String getPrincipal()
       The identity of this peer. Similar to `Request.auth.principal`, but
       relative to the peer instead of the request. For example, the
       identity associated with a load balancer that forwarded the request.
       
      string principal = 7 [json_name = "principal"];
      Specified by:
      getPrincipal in interface AttributeContext.PeerOrBuilder
      Returns:
      The principal.
    • getPrincipalBytes

      public com.google.protobuf.ByteString getPrincipalBytes()
       The identity of this peer. Similar to `Request.auth.principal`, but
       relative to the peer instead of the request. For example, the
       identity associated with a load balancer that forwarded the request.
       
      string principal = 7 [json_name = "principal"];
      Specified by:
      getPrincipalBytes in interface AttributeContext.PeerOrBuilder
      Returns:
      The bytes for principal.
    • setPrincipal

      public AttributeContext.Peer.Builder setPrincipal(String value)
       The identity of this peer. Similar to `Request.auth.principal`, but
       relative to the peer instead of the request. For example, the
       identity associated with a load balancer that forwarded the request.
       
      string principal = 7 [json_name = "principal"];
      Parameters:
      value - The principal to set.
      Returns:
      This builder for chaining.
    • clearPrincipal

      public AttributeContext.Peer.Builder clearPrincipal()
       The identity of this peer. Similar to `Request.auth.principal`, but
       relative to the peer instead of the request. For example, the
       identity associated with a load balancer that forwarded the request.
       
      string principal = 7 [json_name = "principal"];
      Returns:
      This builder for chaining.
    • setPrincipalBytes

      public AttributeContext.Peer.Builder setPrincipalBytes(com.google.protobuf.ByteString value)
       The identity of this peer. Similar to `Request.auth.principal`, but
       relative to the peer instead of the request. For example, the
       identity associated with a load balancer that forwarded the request.
       
      string principal = 7 [json_name = "principal"];
      Parameters:
      value - The bytes for principal to set.
      Returns:
      This builder for chaining.
    • getRegionCode

      public String getRegionCode()
       The CLDR country/region code associated with the above IP address.
       If the IP address is private, the `region_code` should reflect the
       physical location where this peer is running.
       
      string region_code = 8 [json_name = "regionCode"];
      Specified by:
      getRegionCode in interface AttributeContext.PeerOrBuilder
      Returns:
      The regionCode.
    • getRegionCodeBytes

      public com.google.protobuf.ByteString getRegionCodeBytes()
       The CLDR country/region code associated with the above IP address.
       If the IP address is private, the `region_code` should reflect the
       physical location where this peer is running.
       
      string region_code = 8 [json_name = "regionCode"];
      Specified by:
      getRegionCodeBytes in interface AttributeContext.PeerOrBuilder
      Returns:
      The bytes for regionCode.
    • setRegionCode

      public AttributeContext.Peer.Builder setRegionCode(String value)
       The CLDR country/region code associated with the above IP address.
       If the IP address is private, the `region_code` should reflect the
       physical location where this peer is running.
       
      string region_code = 8 [json_name = "regionCode"];
      Parameters:
      value - The regionCode to set.
      Returns:
      This builder for chaining.
    • clearRegionCode

      public AttributeContext.Peer.Builder clearRegionCode()
       The CLDR country/region code associated with the above IP address.
       If the IP address is private, the `region_code` should reflect the
       physical location where this peer is running.
       
      string region_code = 8 [json_name = "regionCode"];
      Returns:
      This builder for chaining.
    • setRegionCodeBytes

      public AttributeContext.Peer.Builder setRegionCodeBytes(com.google.protobuf.ByteString value)
       The CLDR country/region code associated with the above IP address.
       If the IP address is private, the `region_code` should reflect the
       physical location where this peer is running.
       
      string region_code = 8 [json_name = "regionCode"];
      Parameters:
      value - The bytes for regionCode to set.
      Returns:
      This builder for chaining.