Class RoutingParameter.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<RoutingParameter,RoutingParameter.Builder>
com.google.api.RoutingParameter.Builder
All Implemented Interfaces:
RoutingParameterOrBuilder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, Cloneable
Enclosing class:
RoutingParameter

public static final class RoutingParameter.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<RoutingParameter,RoutingParameter.Builder> implements RoutingParameterOrBuilder
 A projection from an input message to the GRPC or REST header.
 
Protobuf type google.api.RoutingParameter
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    A request field to extract the header key-value pair from.
    A pattern matching the key-value field.
    A request field to extract the header key-value pair from.
    com.google.protobuf.ByteString
    A request field to extract the header key-value pair from.
    A pattern matching the key-value field.
    com.google.protobuf.ByteString
    A pattern matching the key-value field.
    A request field to extract the header key-value pair from.
    setFieldBytes(com.google.protobuf.ByteString value)
    A request field to extract the header key-value pair from.
    A pattern matching the key-value field.
    setPathTemplateBytes(com.google.protobuf.ByteString value)
    A pattern matching the key-value field.

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • getField

      public String getField()
       A request field to extract the header key-value pair from.
       
      string field = 1 [json_name = "field"];
      Specified by:
      getField in interface RoutingParameterOrBuilder
      Returns:
      The field.
    • getFieldBytes

      public com.google.protobuf.ByteString getFieldBytes()
       A request field to extract the header key-value pair from.
       
      string field = 1 [json_name = "field"];
      Specified by:
      getFieldBytes in interface RoutingParameterOrBuilder
      Returns:
      The bytes for field.
    • setField

      public RoutingParameter.Builder setField(String value)
       A request field to extract the header key-value pair from.
       
      string field = 1 [json_name = "field"];
      Parameters:
      value - The field to set.
      Returns:
      This builder for chaining.
    • clearField

      public RoutingParameter.Builder clearField()
       A request field to extract the header key-value pair from.
       
      string field = 1 [json_name = "field"];
      Returns:
      This builder for chaining.
    • setFieldBytes

      public RoutingParameter.Builder setFieldBytes(com.google.protobuf.ByteString value)
       A request field to extract the header key-value pair from.
       
      string field = 1 [json_name = "field"];
      Parameters:
      value - The bytes for field to set.
      Returns:
      This builder for chaining.
    • getPathTemplate

      public String getPathTemplate()
       A pattern matching the key-value field. Optional.
       If not specified, the whole field specified in the `field` field will be
       taken as value, and its name used as key. If specified, it MUST contain
       exactly one named segment (along with any number of unnamed segments) The
       pattern will be matched over the field specified in the `field` field, then
       if the match is successful:
       - the name of the single named segment will be used as a header name,
       - the match value of the segment will be used as a header value;
       if the match is NOT successful, nothing will be sent.
      
       Example:
      
       -- This is a field in the request message
       |   that the header value will be extracted from.
       |
       |                     -- This is the key name in the
       |                    |   routing header.
       V                    |
       field: "table_name"           v
       path_template: "projects/*/{table_location=instances/*}/tables/*"
       ^            ^
       |            |
       In the {} brackets is the pattern that --             |
       specifies what to extract from the                    |
       field as a value to be sent.                          |
       |
       The string in the field must match the whole pattern --
       before brackets, inside brackets, after brackets.
      
       When looking at this specific example, we can see that:
       - A key-value pair with the key `table_location`
       and the value matching `instances/*` should be added
       to the x-goog-request-params routing header.
       - The value is extracted from the request message's `table_name` field
       if it matches the full pattern specified:
       `projects/*/instances/*/tables/*`.
      
       **NB:** If the `path_template` field is not provided, the key name is
       equal to the field name, and the whole field should be sent as a value.
       This makes the pattern for the field and the value functionally equivalent
       to `**`, and the configuration
      
       {
       field: "table_name"
       }
      
       is a functionally equivalent shorthand to:
      
       {
       field: "table_name"
       path_template: "{table_name=**}"
       }
      
       See Example 1 for more details.
       
      string path_template = 2 [json_name = "pathTemplate"];
      Specified by:
      getPathTemplate in interface RoutingParameterOrBuilder
      Returns:
      The pathTemplate.
    • getPathTemplateBytes

      public com.google.protobuf.ByteString getPathTemplateBytes()
       A pattern matching the key-value field. Optional.
       If not specified, the whole field specified in the `field` field will be
       taken as value, and its name used as key. If specified, it MUST contain
       exactly one named segment (along with any number of unnamed segments) The
       pattern will be matched over the field specified in the `field` field, then
       if the match is successful:
       - the name of the single named segment will be used as a header name,
       - the match value of the segment will be used as a header value;
       if the match is NOT successful, nothing will be sent.
      
       Example:
      
       -- This is a field in the request message
       |   that the header value will be extracted from.
       |
       |                     -- This is the key name in the
       |                    |   routing header.
       V                    |
       field: "table_name"           v
       path_template: "projects/*/{table_location=instances/*}/tables/*"
       ^            ^
       |            |
       In the {} brackets is the pattern that --             |
       specifies what to extract from the                    |
       field as a value to be sent.                          |
       |
       The string in the field must match the whole pattern --
       before brackets, inside brackets, after brackets.
      
       When looking at this specific example, we can see that:
       - A key-value pair with the key `table_location`
       and the value matching `instances/*` should be added
       to the x-goog-request-params routing header.
       - The value is extracted from the request message's `table_name` field
       if it matches the full pattern specified:
       `projects/*/instances/*/tables/*`.
      
       **NB:** If the `path_template` field is not provided, the key name is
       equal to the field name, and the whole field should be sent as a value.
       This makes the pattern for the field and the value functionally equivalent
       to `**`, and the configuration
      
       {
       field: "table_name"
       }
      
       is a functionally equivalent shorthand to:
      
       {
       field: "table_name"
       path_template: "{table_name=**}"
       }
      
       See Example 1 for more details.
       
      string path_template = 2 [json_name = "pathTemplate"];
      Specified by:
      getPathTemplateBytes in interface RoutingParameterOrBuilder
      Returns:
      The bytes for pathTemplate.
    • setPathTemplate

      public RoutingParameter.Builder setPathTemplate(String value)
       A pattern matching the key-value field. Optional.
       If not specified, the whole field specified in the `field` field will be
       taken as value, and its name used as key. If specified, it MUST contain
       exactly one named segment (along with any number of unnamed segments) The
       pattern will be matched over the field specified in the `field` field, then
       if the match is successful:
       - the name of the single named segment will be used as a header name,
       - the match value of the segment will be used as a header value;
       if the match is NOT successful, nothing will be sent.
      
       Example:
      
       -- This is a field in the request message
       |   that the header value will be extracted from.
       |
       |                     -- This is the key name in the
       |                    |   routing header.
       V                    |
       field: "table_name"           v
       path_template: "projects/*/{table_location=instances/*}/tables/*"
       ^            ^
       |            |
       In the {} brackets is the pattern that --             |
       specifies what to extract from the                    |
       field as a value to be sent.                          |
       |
       The string in the field must match the whole pattern --
       before brackets, inside brackets, after brackets.
      
       When looking at this specific example, we can see that:
       - A key-value pair with the key `table_location`
       and the value matching `instances/*` should be added
       to the x-goog-request-params routing header.
       - The value is extracted from the request message's `table_name` field
       if it matches the full pattern specified:
       `projects/*/instances/*/tables/*`.
      
       **NB:** If the `path_template` field is not provided, the key name is
       equal to the field name, and the whole field should be sent as a value.
       This makes the pattern for the field and the value functionally equivalent
       to `**`, and the configuration
      
       {
       field: "table_name"
       }
      
       is a functionally equivalent shorthand to:
      
       {
       field: "table_name"
       path_template: "{table_name=**}"
       }
      
       See Example 1 for more details.
       
      string path_template = 2 [json_name = "pathTemplate"];
      Parameters:
      value - The pathTemplate to set.
      Returns:
      This builder for chaining.
    • clearPathTemplate

      public RoutingParameter.Builder clearPathTemplate()
       A pattern matching the key-value field. Optional.
       If not specified, the whole field specified in the `field` field will be
       taken as value, and its name used as key. If specified, it MUST contain
       exactly one named segment (along with any number of unnamed segments) The
       pattern will be matched over the field specified in the `field` field, then
       if the match is successful:
       - the name of the single named segment will be used as a header name,
       - the match value of the segment will be used as a header value;
       if the match is NOT successful, nothing will be sent.
      
       Example:
      
       -- This is a field in the request message
       |   that the header value will be extracted from.
       |
       |                     -- This is the key name in the
       |                    |   routing header.
       V                    |
       field: "table_name"           v
       path_template: "projects/*/{table_location=instances/*}/tables/*"
       ^            ^
       |            |
       In the {} brackets is the pattern that --             |
       specifies what to extract from the                    |
       field as a value to be sent.                          |
       |
       The string in the field must match the whole pattern --
       before brackets, inside brackets, after brackets.
      
       When looking at this specific example, we can see that:
       - A key-value pair with the key `table_location`
       and the value matching `instances/*` should be added
       to the x-goog-request-params routing header.
       - The value is extracted from the request message's `table_name` field
       if it matches the full pattern specified:
       `projects/*/instances/*/tables/*`.
      
       **NB:** If the `path_template` field is not provided, the key name is
       equal to the field name, and the whole field should be sent as a value.
       This makes the pattern for the field and the value functionally equivalent
       to `**`, and the configuration
      
       {
       field: "table_name"
       }
      
       is a functionally equivalent shorthand to:
      
       {
       field: "table_name"
       path_template: "{table_name=**}"
       }
      
       See Example 1 for more details.
       
      string path_template = 2 [json_name = "pathTemplate"];
      Returns:
      This builder for chaining.
    • setPathTemplateBytes

      public RoutingParameter.Builder setPathTemplateBytes(com.google.protobuf.ByteString value)
       A pattern matching the key-value field. Optional.
       If not specified, the whole field specified in the `field` field will be
       taken as value, and its name used as key. If specified, it MUST contain
       exactly one named segment (along with any number of unnamed segments) The
       pattern will be matched over the field specified in the `field` field, then
       if the match is successful:
       - the name of the single named segment will be used as a header name,
       - the match value of the segment will be used as a header value;
       if the match is NOT successful, nothing will be sent.
      
       Example:
      
       -- This is a field in the request message
       |   that the header value will be extracted from.
       |
       |                     -- This is the key name in the
       |                    |   routing header.
       V                    |
       field: "table_name"           v
       path_template: "projects/*/{table_location=instances/*}/tables/*"
       ^            ^
       |            |
       In the {} brackets is the pattern that --             |
       specifies what to extract from the                    |
       field as a value to be sent.                          |
       |
       The string in the field must match the whole pattern --
       before brackets, inside brackets, after brackets.
      
       When looking at this specific example, we can see that:
       - A key-value pair with the key `table_location`
       and the value matching `instances/*` should be added
       to the x-goog-request-params routing header.
       - The value is extracted from the request message's `table_name` field
       if it matches the full pattern specified:
       `projects/*/instances/*/tables/*`.
      
       **NB:** If the `path_template` field is not provided, the key name is
       equal to the field name, and the whole field should be sent as a value.
       This makes the pattern for the field and the value functionally equivalent
       to `**`, and the configuration
      
       {
       field: "table_name"
       }
      
       is a functionally equivalent shorthand to:
      
       {
       field: "table_name"
       path_template: "{table_name=**}"
       }
      
       See Example 1 for more details.
       
      string path_template = 2 [json_name = "pathTemplate"];
      Parameters:
      value - The bytes for pathTemplate to set.
      Returns:
      This builder for chaining.