Class UrlRewrite.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<UrlRewrite.Builder>
com.google.cloud.compute.v1.UrlRewrite.Builder
All Implemented Interfaces:
UrlRewriteOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
UrlRewrite

public static final class UrlRewrite.Builder extends com.google.protobuf.GeneratedMessage.Builder<UrlRewrite.Builder> implements UrlRewriteOrBuilder
 The spec for modifying the path before sending the request to the matched
 backend service.
 
Protobuf type google.cloud.compute.v1.UrlRewrite
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite.
    Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced bypathPrefixRewrite.
    If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite.
    com.google.protobuf.ByteString
    Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite.
    Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced bypathPrefixRewrite.
    com.google.protobuf.ByteString
    Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced bypathPrefixRewrite.
    If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax.
    com.google.protobuf.ByteString
    If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax.
    boolean
    Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite.
    boolean
    Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced bypathPrefixRewrite.
    boolean
    If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite.
    setHostRewriteBytes(com.google.protobuf.ByteString value)
    Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite.
    Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced bypathPrefixRewrite.
    setPathPrefixRewriteBytes(com.google.protobuf.ByteString value)
    Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced bypathPrefixRewrite.
    If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax.
    setPathTemplateRewriteBytes(com.google.protobuf.ByteString value)
    If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax.

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

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

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

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

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

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<UrlRewrite.Builder>
    • clear

      public UrlRewrite.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<UrlRewrite.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<UrlRewrite.Builder>
    • getDefaultInstanceForType

      public UrlRewrite getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public UrlRewrite build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public UrlRewrite buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public UrlRewrite.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<UrlRewrite.Builder>
    • mergeFrom

      public UrlRewrite.Builder mergeFrom(UrlRewrite other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<UrlRewrite.Builder>
    • mergeFrom

      public UrlRewrite.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<UrlRewrite.Builder>
      Throws:
      IOException
    • hasHostRewrite

      public boolean hasHostRewrite()
       Before forwarding the request to the selected service, the request's
       host header is replaced with contents of hostRewrite.
      
       The value must be from 1 to 255 characters.
       
      optional string host_rewrite = 159819253;
      Specified by:
      hasHostRewrite in interface UrlRewriteOrBuilder
      Returns:
      Whether the hostRewrite field is set.
    • getHostRewrite

      public String getHostRewrite()
       Before forwarding the request to the selected service, the request's
       host header is replaced with contents of hostRewrite.
      
       The value must be from 1 to 255 characters.
       
      optional string host_rewrite = 159819253;
      Specified by:
      getHostRewrite in interface UrlRewriteOrBuilder
      Returns:
      The hostRewrite.
    • getHostRewriteBytes

      public com.google.protobuf.ByteString getHostRewriteBytes()
       Before forwarding the request to the selected service, the request's
       host header is replaced with contents of hostRewrite.
      
       The value must be from 1 to 255 characters.
       
      optional string host_rewrite = 159819253;
      Specified by:
      getHostRewriteBytes in interface UrlRewriteOrBuilder
      Returns:
      The bytes for hostRewrite.
    • setHostRewrite

      public UrlRewrite.Builder setHostRewrite(String value)
       Before forwarding the request to the selected service, the request's
       host header is replaced with contents of hostRewrite.
      
       The value must be from 1 to 255 characters.
       
      optional string host_rewrite = 159819253;
      Parameters:
      value - The hostRewrite to set.
      Returns:
      This builder for chaining.
    • clearHostRewrite

      public UrlRewrite.Builder clearHostRewrite()
       Before forwarding the request to the selected service, the request's
       host header is replaced with contents of hostRewrite.
      
       The value must be from 1 to 255 characters.
       
      optional string host_rewrite = 159819253;
      Returns:
      This builder for chaining.
    • setHostRewriteBytes

      public UrlRewrite.Builder setHostRewriteBytes(com.google.protobuf.ByteString value)
       Before forwarding the request to the selected service, the request's
       host header is replaced with contents of hostRewrite.
      
       The value must be from 1 to 255 characters.
       
      optional string host_rewrite = 159819253;
      Parameters:
      value - The bytes for hostRewrite to set.
      Returns:
      This builder for chaining.
    • hasPathPrefixRewrite

      public boolean hasPathPrefixRewrite()
       Before forwarding the request to the selected backend service, the
       matching portion of the request's path is replaced bypathPrefixRewrite.
      
       The value must be from 1 to 1024 characters.
       
      optional string path_prefix_rewrite = 41186361;
      Specified by:
      hasPathPrefixRewrite in interface UrlRewriteOrBuilder
      Returns:
      Whether the pathPrefixRewrite field is set.
    • getPathPrefixRewrite

      public String getPathPrefixRewrite()
       Before forwarding the request to the selected backend service, the
       matching portion of the request's path is replaced bypathPrefixRewrite.
      
       The value must be from 1 to 1024 characters.
       
      optional string path_prefix_rewrite = 41186361;
      Specified by:
      getPathPrefixRewrite in interface UrlRewriteOrBuilder
      Returns:
      The pathPrefixRewrite.
    • getPathPrefixRewriteBytes

      public com.google.protobuf.ByteString getPathPrefixRewriteBytes()
       Before forwarding the request to the selected backend service, the
       matching portion of the request's path is replaced bypathPrefixRewrite.
      
       The value must be from 1 to 1024 characters.
       
      optional string path_prefix_rewrite = 41186361;
      Specified by:
      getPathPrefixRewriteBytes in interface UrlRewriteOrBuilder
      Returns:
      The bytes for pathPrefixRewrite.
    • setPathPrefixRewrite

      public UrlRewrite.Builder setPathPrefixRewrite(String value)
       Before forwarding the request to the selected backend service, the
       matching portion of the request's path is replaced bypathPrefixRewrite.
      
       The value must be from 1 to 1024 characters.
       
      optional string path_prefix_rewrite = 41186361;
      Parameters:
      value - The pathPrefixRewrite to set.
      Returns:
      This builder for chaining.
    • clearPathPrefixRewrite

      public UrlRewrite.Builder clearPathPrefixRewrite()
       Before forwarding the request to the selected backend service, the
       matching portion of the request's path is replaced bypathPrefixRewrite.
      
       The value must be from 1 to 1024 characters.
       
      optional string path_prefix_rewrite = 41186361;
      Returns:
      This builder for chaining.
    • setPathPrefixRewriteBytes

      public UrlRewrite.Builder setPathPrefixRewriteBytes(com.google.protobuf.ByteString value)
       Before forwarding the request to the selected backend service, the
       matching portion of the request's path is replaced bypathPrefixRewrite.
      
       The value must be from 1 to 1024 characters.
       
      optional string path_prefix_rewrite = 41186361;
      Parameters:
      value - The bytes for pathPrefixRewrite to set.
      Returns:
      This builder for chaining.
    • hasPathTemplateRewrite

      public boolean hasPathTemplateRewrite()
       If specified, the pattern rewrites the URL path (based on the :path
       header) using the HTTP template syntax.
      
       A corresponding
       path_template_match must be specified. Any template variables must exist in
       the path_template_match field.
      
      
       - -At least one variable must be specified in the path_template_match
       field
       - You can omit variables from the rewritten URL
       - The * and ** operators cannot be matched
       unless they have a corresponding variable name - e.g.
       {format=*} or {var=**}.
      
       For example, a path_template_match of /static/{format=**}
       could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a
       rewrite, so that /{country}/{format}/{suffix=**} can be
       rewritten as /content/{format}/{country}/{suffix}.
      
       At least
       one non-empty routeRules[].matchRules[].path_template_match is
       required.
      
       Only one of path_prefix_rewrite orpath_template_rewrite may be specified.
       
      optional string path_template_rewrite = 423409569;
      Specified by:
      hasPathTemplateRewrite in interface UrlRewriteOrBuilder
      Returns:
      Whether the pathTemplateRewrite field is set.
    • getPathTemplateRewrite

      public String getPathTemplateRewrite()
       If specified, the pattern rewrites the URL path (based on the :path
       header) using the HTTP template syntax.
      
       A corresponding
       path_template_match must be specified. Any template variables must exist in
       the path_template_match field.
      
      
       - -At least one variable must be specified in the path_template_match
       field
       - You can omit variables from the rewritten URL
       - The * and ** operators cannot be matched
       unless they have a corresponding variable name - e.g.
       {format=*} or {var=**}.
      
       For example, a path_template_match of /static/{format=**}
       could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a
       rewrite, so that /{country}/{format}/{suffix=**} can be
       rewritten as /content/{format}/{country}/{suffix}.
      
       At least
       one non-empty routeRules[].matchRules[].path_template_match is
       required.
      
       Only one of path_prefix_rewrite orpath_template_rewrite may be specified.
       
      optional string path_template_rewrite = 423409569;
      Specified by:
      getPathTemplateRewrite in interface UrlRewriteOrBuilder
      Returns:
      The pathTemplateRewrite.
    • getPathTemplateRewriteBytes

      public com.google.protobuf.ByteString getPathTemplateRewriteBytes()
       If specified, the pattern rewrites the URL path (based on the :path
       header) using the HTTP template syntax.
      
       A corresponding
       path_template_match must be specified. Any template variables must exist in
       the path_template_match field.
      
      
       - -At least one variable must be specified in the path_template_match
       field
       - You can omit variables from the rewritten URL
       - The * and ** operators cannot be matched
       unless they have a corresponding variable name - e.g.
       {format=*} or {var=**}.
      
       For example, a path_template_match of /static/{format=**}
       could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a
       rewrite, so that /{country}/{format}/{suffix=**} can be
       rewritten as /content/{format}/{country}/{suffix}.
      
       At least
       one non-empty routeRules[].matchRules[].path_template_match is
       required.
      
       Only one of path_prefix_rewrite orpath_template_rewrite may be specified.
       
      optional string path_template_rewrite = 423409569;
      Specified by:
      getPathTemplateRewriteBytes in interface UrlRewriteOrBuilder
      Returns:
      The bytes for pathTemplateRewrite.
    • setPathTemplateRewrite

      public UrlRewrite.Builder setPathTemplateRewrite(String value)
       If specified, the pattern rewrites the URL path (based on the :path
       header) using the HTTP template syntax.
      
       A corresponding
       path_template_match must be specified. Any template variables must exist in
       the path_template_match field.
      
      
       - -At least one variable must be specified in the path_template_match
       field
       - You can omit variables from the rewritten URL
       - The * and ** operators cannot be matched
       unless they have a corresponding variable name - e.g.
       {format=*} or {var=**}.
      
       For example, a path_template_match of /static/{format=**}
       could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a
       rewrite, so that /{country}/{format}/{suffix=**} can be
       rewritten as /content/{format}/{country}/{suffix}.
      
       At least
       one non-empty routeRules[].matchRules[].path_template_match is
       required.
      
       Only one of path_prefix_rewrite orpath_template_rewrite may be specified.
       
      optional string path_template_rewrite = 423409569;
      Parameters:
      value - The pathTemplateRewrite to set.
      Returns:
      This builder for chaining.
    • clearPathTemplateRewrite

      public UrlRewrite.Builder clearPathTemplateRewrite()
       If specified, the pattern rewrites the URL path (based on the :path
       header) using the HTTP template syntax.
      
       A corresponding
       path_template_match must be specified. Any template variables must exist in
       the path_template_match field.
      
      
       - -At least one variable must be specified in the path_template_match
       field
       - You can omit variables from the rewritten URL
       - The * and ** operators cannot be matched
       unless they have a corresponding variable name - e.g.
       {format=*} or {var=**}.
      
       For example, a path_template_match of /static/{format=**}
       could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a
       rewrite, so that /{country}/{format}/{suffix=**} can be
       rewritten as /content/{format}/{country}/{suffix}.
      
       At least
       one non-empty routeRules[].matchRules[].path_template_match is
       required.
      
       Only one of path_prefix_rewrite orpath_template_rewrite may be specified.
       
      optional string path_template_rewrite = 423409569;
      Returns:
      This builder for chaining.
    • setPathTemplateRewriteBytes

      public UrlRewrite.Builder setPathTemplateRewriteBytes(com.google.protobuf.ByteString value)
       If specified, the pattern rewrites the URL path (based on the :path
       header) using the HTTP template syntax.
      
       A corresponding
       path_template_match must be specified. Any template variables must exist in
       the path_template_match field.
      
      
       - -At least one variable must be specified in the path_template_match
       field
       - You can omit variables from the rewritten URL
       - The * and ** operators cannot be matched
       unless they have a corresponding variable name - e.g.
       {format=*} or {var=**}.
      
       For example, a path_template_match of /static/{format=**}
       could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a
       rewrite, so that /{country}/{format}/{suffix=**} can be
       rewritten as /content/{format}/{country}/{suffix}.
      
       At least
       one non-empty routeRules[].matchRules[].path_template_match is
       required.
      
       Only one of path_prefix_rewrite orpath_template_rewrite may be specified.
       
      optional string path_template_rewrite = 423409569;
      Parameters:
      value - The bytes for pathTemplateRewrite to set.
      Returns:
      This builder for chaining.