Class HttpRoute.CorsPolicy.Builder

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

public static final class HttpRoute.CorsPolicy.Builder extends com.google.protobuf.GeneratedMessage.Builder<HttpRoute.CorsPolicy.Builder> implements HttpRoute.CorsPolicyOrBuilder
 The Specification for allowing client side cross-origin requests.
 
Protobuf type google.cloud.networkservices.v1.HttpRoute.CorsPolicy
  • 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<HttpRoute.CorsPolicy.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<HttpRoute.CorsPolicy.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<HttpRoute.CorsPolicy.Builder>
    • getDefaultInstanceForType

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

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

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

      public HttpRoute.CorsPolicy.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<HttpRoute.CorsPolicy.Builder>
    • mergeFrom

    • isInitialized

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

      public HttpRoute.CorsPolicy.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<HttpRoute.CorsPolicy.Builder>
      Throws:
      IOException
    • getAllowOriginsList

      public com.google.protobuf.ProtocolStringList getAllowOriginsList()
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Specified by:
      getAllowOriginsList in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      A list containing the allowOrigins.
    • getAllowOriginsCount

      public int getAllowOriginsCount()
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Specified by:
      getAllowOriginsCount in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The count of allowOrigins.
    • getAllowOrigins

      public String getAllowOrigins(int index)
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Specified by:
      getAllowOrigins in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The allowOrigins at the given index.
    • getAllowOriginsBytes

      public com.google.protobuf.ByteString getAllowOriginsBytes(int index)
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Specified by:
      getAllowOriginsBytes in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the allowOrigins at the given index.
    • setAllowOrigins

      public HttpRoute.CorsPolicy.Builder setAllowOrigins(int index, String value)
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Parameters:
      index - The index to set the value at.
      value - The allowOrigins to set.
      Returns:
      This builder for chaining.
    • addAllowOrigins

      public HttpRoute.CorsPolicy.Builder addAllowOrigins(String value)
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Parameters:
      value - The allowOrigins to add.
      Returns:
      This builder for chaining.
    • addAllAllowOrigins

      public HttpRoute.CorsPolicy.Builder addAllAllowOrigins(Iterable<String> values)
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Parameters:
      values - The allowOrigins to add.
      Returns:
      This builder for chaining.
    • clearAllowOrigins

      public HttpRoute.CorsPolicy.Builder clearAllowOrigins()
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Returns:
      This builder for chaining.
    • addAllowOriginsBytes

      public HttpRoute.CorsPolicy.Builder addAllowOriginsBytes(com.google.protobuf.ByteString value)
       Specifies the list of origins that will be allowed to do CORS requests.
       An origin is allowed if it matches either an item in allow_origins or
       an item in allow_origin_regexes.
       
      repeated string allow_origins = 1;
      Parameters:
      value - The bytes of the allowOrigins to add.
      Returns:
      This builder for chaining.
    • getAllowOriginRegexesList

      public com.google.protobuf.ProtocolStringList getAllowOriginRegexesList()
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Specified by:
      getAllowOriginRegexesList in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      A list containing the allowOriginRegexes.
    • getAllowOriginRegexesCount

      public int getAllowOriginRegexesCount()
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Specified by:
      getAllowOriginRegexesCount in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The count of allowOriginRegexes.
    • getAllowOriginRegexes

      public String getAllowOriginRegexes(int index)
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Specified by:
      getAllowOriginRegexes in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The allowOriginRegexes at the given index.
    • getAllowOriginRegexesBytes

      public com.google.protobuf.ByteString getAllowOriginRegexesBytes(int index)
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Specified by:
      getAllowOriginRegexesBytes in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the allowOriginRegexes at the given index.
    • setAllowOriginRegexes

      public HttpRoute.CorsPolicy.Builder setAllowOriginRegexes(int index, String value)
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Parameters:
      index - The index to set the value at.
      value - The allowOriginRegexes to set.
      Returns:
      This builder for chaining.
    • addAllowOriginRegexes

      public HttpRoute.CorsPolicy.Builder addAllowOriginRegexes(String value)
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Parameters:
      value - The allowOriginRegexes to add.
      Returns:
      This builder for chaining.
    • addAllAllowOriginRegexes

      public HttpRoute.CorsPolicy.Builder addAllAllowOriginRegexes(Iterable<String> values)
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Parameters:
      values - The allowOriginRegexes to add.
      Returns:
      This builder for chaining.
    • clearAllowOriginRegexes

      public HttpRoute.CorsPolicy.Builder clearAllowOriginRegexes()
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Returns:
      This builder for chaining.
    • addAllowOriginRegexesBytes

      public HttpRoute.CorsPolicy.Builder addAllowOriginRegexesBytes(com.google.protobuf.ByteString value)
       Specifies the regular expression patterns that match allowed origins. For
       regular expression grammar, please see
       https://github.com/google/re2/wiki/Syntax.
       
      repeated string allow_origin_regexes = 2;
      Parameters:
      value - The bytes of the allowOriginRegexes to add.
      Returns:
      This builder for chaining.
    • getAllowMethodsList

      public com.google.protobuf.ProtocolStringList getAllowMethodsList()
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Specified by:
      getAllowMethodsList in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      A list containing the allowMethods.
    • getAllowMethodsCount

      public int getAllowMethodsCount()
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Specified by:
      getAllowMethodsCount in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The count of allowMethods.
    • getAllowMethods

      public String getAllowMethods(int index)
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Specified by:
      getAllowMethods in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The allowMethods at the given index.
    • getAllowMethodsBytes

      public com.google.protobuf.ByteString getAllowMethodsBytes(int index)
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Specified by:
      getAllowMethodsBytes in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the allowMethods at the given index.
    • setAllowMethods

      public HttpRoute.CorsPolicy.Builder setAllowMethods(int index, String value)
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Parameters:
      index - The index to set the value at.
      value - The allowMethods to set.
      Returns:
      This builder for chaining.
    • addAllowMethods

      public HttpRoute.CorsPolicy.Builder addAllowMethods(String value)
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Parameters:
      value - The allowMethods to add.
      Returns:
      This builder for chaining.
    • addAllAllowMethods

      public HttpRoute.CorsPolicy.Builder addAllAllowMethods(Iterable<String> values)
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Parameters:
      values - The allowMethods to add.
      Returns:
      This builder for chaining.
    • clearAllowMethods

      public HttpRoute.CorsPolicy.Builder clearAllowMethods()
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Returns:
      This builder for chaining.
    • addAllowMethodsBytes

      public HttpRoute.CorsPolicy.Builder addAllowMethodsBytes(com.google.protobuf.ByteString value)
       Specifies the content for Access-Control-Allow-Methods header.
       
      repeated string allow_methods = 3;
      Parameters:
      value - The bytes of the allowMethods to add.
      Returns:
      This builder for chaining.
    • getAllowHeadersList

      public com.google.protobuf.ProtocolStringList getAllowHeadersList()
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Specified by:
      getAllowHeadersList in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      A list containing the allowHeaders.
    • getAllowHeadersCount

      public int getAllowHeadersCount()
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Specified by:
      getAllowHeadersCount in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The count of allowHeaders.
    • getAllowHeaders

      public String getAllowHeaders(int index)
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Specified by:
      getAllowHeaders in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The allowHeaders at the given index.
    • getAllowHeadersBytes

      public com.google.protobuf.ByteString getAllowHeadersBytes(int index)
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Specified by:
      getAllowHeadersBytes in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the allowHeaders at the given index.
    • setAllowHeaders

      public HttpRoute.CorsPolicy.Builder setAllowHeaders(int index, String value)
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Parameters:
      index - The index to set the value at.
      value - The allowHeaders to set.
      Returns:
      This builder for chaining.
    • addAllowHeaders

      public HttpRoute.CorsPolicy.Builder addAllowHeaders(String value)
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Parameters:
      value - The allowHeaders to add.
      Returns:
      This builder for chaining.
    • addAllAllowHeaders

      public HttpRoute.CorsPolicy.Builder addAllAllowHeaders(Iterable<String> values)
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Parameters:
      values - The allowHeaders to add.
      Returns:
      This builder for chaining.
    • clearAllowHeaders

      public HttpRoute.CorsPolicy.Builder clearAllowHeaders()
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Returns:
      This builder for chaining.
    • addAllowHeadersBytes

      public HttpRoute.CorsPolicy.Builder addAllowHeadersBytes(com.google.protobuf.ByteString value)
       Specifies the content for Access-Control-Allow-Headers header.
       
      repeated string allow_headers = 4;
      Parameters:
      value - The bytes of the allowHeaders to add.
      Returns:
      This builder for chaining.
    • getExposeHeadersList

      public com.google.protobuf.ProtocolStringList getExposeHeadersList()
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Specified by:
      getExposeHeadersList in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      A list containing the exposeHeaders.
    • getExposeHeadersCount

      public int getExposeHeadersCount()
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Specified by:
      getExposeHeadersCount in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The count of exposeHeaders.
    • getExposeHeaders

      public String getExposeHeaders(int index)
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Specified by:
      getExposeHeaders in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The exposeHeaders at the given index.
    • getExposeHeadersBytes

      public com.google.protobuf.ByteString getExposeHeadersBytes(int index)
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Specified by:
      getExposeHeadersBytes in interface HttpRoute.CorsPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the exposeHeaders at the given index.
    • setExposeHeaders

      public HttpRoute.CorsPolicy.Builder setExposeHeaders(int index, String value)
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Parameters:
      index - The index to set the value at.
      value - The exposeHeaders to set.
      Returns:
      This builder for chaining.
    • addExposeHeaders

      public HttpRoute.CorsPolicy.Builder addExposeHeaders(String value)
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Parameters:
      value - The exposeHeaders to add.
      Returns:
      This builder for chaining.
    • addAllExposeHeaders

      public HttpRoute.CorsPolicy.Builder addAllExposeHeaders(Iterable<String> values)
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Parameters:
      values - The exposeHeaders to add.
      Returns:
      This builder for chaining.
    • clearExposeHeaders

      public HttpRoute.CorsPolicy.Builder clearExposeHeaders()
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Returns:
      This builder for chaining.
    • addExposeHeadersBytes

      public HttpRoute.CorsPolicy.Builder addExposeHeadersBytes(com.google.protobuf.ByteString value)
       Specifies the content for Access-Control-Expose-Headers header.
       
      repeated string expose_headers = 5;
      Parameters:
      value - The bytes of the exposeHeaders to add.
      Returns:
      This builder for chaining.
    • getMaxAge

      public String getMaxAge()
       Specifies how long result of a preflight request can be cached in
       seconds. This translates to the Access-Control-Max-Age header.
       
      string max_age = 6;
      Specified by:
      getMaxAge in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The maxAge.
    • getMaxAgeBytes

      public com.google.protobuf.ByteString getMaxAgeBytes()
       Specifies how long result of a preflight request can be cached in
       seconds. This translates to the Access-Control-Max-Age header.
       
      string max_age = 6;
      Specified by:
      getMaxAgeBytes in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The bytes for maxAge.
    • setMaxAge

      public HttpRoute.CorsPolicy.Builder setMaxAge(String value)
       Specifies how long result of a preflight request can be cached in
       seconds. This translates to the Access-Control-Max-Age header.
       
      string max_age = 6;
      Parameters:
      value - The maxAge to set.
      Returns:
      This builder for chaining.
    • clearMaxAge

      public HttpRoute.CorsPolicy.Builder clearMaxAge()
       Specifies how long result of a preflight request can be cached in
       seconds. This translates to the Access-Control-Max-Age header.
       
      string max_age = 6;
      Returns:
      This builder for chaining.
    • setMaxAgeBytes

      public HttpRoute.CorsPolicy.Builder setMaxAgeBytes(com.google.protobuf.ByteString value)
       Specifies how long result of a preflight request can be cached in
       seconds. This translates to the Access-Control-Max-Age header.
       
      string max_age = 6;
      Parameters:
      value - The bytes for maxAge to set.
      Returns:
      This builder for chaining.
    • getAllowCredentials

      public boolean getAllowCredentials()
       In response to a preflight request, setting this to true indicates that
       the actual request can include user credentials. This translates to the
       Access-Control-Allow-Credentials header.
      
       Default value is false.
       
      bool allow_credentials = 7;
      Specified by:
      getAllowCredentials in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The allowCredentials.
    • setAllowCredentials

      public HttpRoute.CorsPolicy.Builder setAllowCredentials(boolean value)
       In response to a preflight request, setting this to true indicates that
       the actual request can include user credentials. This translates to the
       Access-Control-Allow-Credentials header.
      
       Default value is false.
       
      bool allow_credentials = 7;
      Parameters:
      value - The allowCredentials to set.
      Returns:
      This builder for chaining.
    • clearAllowCredentials

      public HttpRoute.CorsPolicy.Builder clearAllowCredentials()
       In response to a preflight request, setting this to true indicates that
       the actual request can include user credentials. This translates to the
       Access-Control-Allow-Credentials header.
      
       Default value is false.
       
      bool allow_credentials = 7;
      Returns:
      This builder for chaining.
    • getDisabled

      public boolean getDisabled()
       If true, the CORS policy is disabled. The default value is false, which
       indicates that the CORS policy is in effect.
       
      bool disabled = 8;
      Specified by:
      getDisabled in interface HttpRoute.CorsPolicyOrBuilder
      Returns:
      The disabled.
    • setDisabled

      public HttpRoute.CorsPolicy.Builder setDisabled(boolean value)
       If true, the CORS policy is disabled. The default value is false, which
       indicates that the CORS policy is in effect.
       
      bool disabled = 8;
      Parameters:
      value - The disabled to set.
      Returns:
      This builder for chaining.
    • clearDisabled

      public HttpRoute.CorsPolicy.Builder clearDisabled()
       If true, the CORS policy is disabled. The default value is false, which
       indicates that the CORS policy is in effect.
       
      bool disabled = 8;
      Returns:
      This builder for chaining.