Class RoutingParameter.Builder (2.33.0)

public static final class RoutingParameter.Builder extends GeneratedMessageV3.Builder<RoutingParameter.Builder> implements RoutingParameterOrBuilder

A projection from an input message to the GRPC or REST header.

Protobuf type google.api.RoutingParameter

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public RoutingParameter.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RoutingParameter.Builder
Overrides

build()

public RoutingParameter build()
Returns
TypeDescription
RoutingParameter

buildPartial()

public RoutingParameter buildPartial()
Returns
TypeDescription
RoutingParameter

clear()

public RoutingParameter.Builder clear()
Returns
TypeDescription
RoutingParameter.Builder
Overrides

clearField()

public RoutingParameter.Builder clearField()

A request field to extract the header key-value pair from.

string field = 1;

Returns
TypeDescription
RoutingParameter.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public RoutingParameter.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
RoutingParameter.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public RoutingParameter.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
RoutingParameter.Builder
Overrides

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;

Returns
TypeDescription
RoutingParameter.Builder

This builder for chaining.

clone()

public RoutingParameter.Builder clone()
Returns
TypeDescription
RoutingParameter.Builder
Overrides

getDefaultInstanceForType()

public RoutingParameter getDefaultInstanceForType()
Returns
TypeDescription
RoutingParameter

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getField()

public String getField()

A request field to extract the header key-value pair from.

string field = 1;

Returns
TypeDescription
String

The field.

getFieldBytes()

public ByteString getFieldBytes()

A request field to extract the header key-value pair from.

string field = 1;

Returns
TypeDescription
ByteString

The bytes for field.

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;

Returns
TypeDescription
String

The pathTemplate.

getPathTemplateBytes()

public 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;

Returns
TypeDescription
ByteString

The bytes for pathTemplate.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(RoutingParameter other)

public RoutingParameter.Builder mergeFrom(RoutingParameter other)
Parameter
NameDescription
otherRoutingParameter
Returns
TypeDescription
RoutingParameter.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public RoutingParameter.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
RoutingParameter.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public RoutingParameter.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
RoutingParameter.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final RoutingParameter.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RoutingParameter.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public RoutingParameter.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RoutingParameter.Builder
Overrides

setField(String value)

public RoutingParameter.Builder setField(String value)

A request field to extract the header key-value pair from.

string field = 1;

Parameter
NameDescription
valueString

The field to set.

Returns
TypeDescription
RoutingParameter.Builder

This builder for chaining.

setFieldBytes(ByteString value)

public RoutingParameter.Builder setFieldBytes(ByteString value)

A request field to extract the header key-value pair from.

string field = 1;

Parameter
NameDescription
valueByteString

The bytes for field to set.

Returns
TypeDescription
RoutingParameter.Builder

This builder for chaining.

setPathTemplate(String value)

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;

Parameter
NameDescription
valueString

The pathTemplate to set.

Returns
TypeDescription
RoutingParameter.Builder

This builder for chaining.

setPathTemplateBytes(ByteString value)

public RoutingParameter.Builder setPathTemplateBytes(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;

Parameter
NameDescription
valueByteString

The bytes for pathTemplate to set.

Returns
TypeDescription
RoutingParameter.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public RoutingParameter.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
RoutingParameter.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final RoutingParameter.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RoutingParameter.Builder
Overrides