Class CorsSupportBase.Builder<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>>

java.lang.Object
io.helidon.cors.CorsSupportBase.Builder<Q,R,T,B>
Type Parameters:
Q - request type wrapped by request adapter
R - response type wrapped by response adapter
T - specific subtype of CorsSupportBase the builder creates
B - type of the builder
All Implemented Interfaces:
Builder<B,CorsSupportBase<Q,R,T,B>>, CorsSetter<CorsSupportBase.Builder<Q,R,T,B>>, Supplier<CorsSupportBase<Q,R,T,B>>
Direct Known Subclasses:
CorsSupport.Builder
Enclosing class:
CorsSupportBase<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>>

public abstract static class CorsSupportBase.Builder<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>> extends Object implements Builder<B,CorsSupportBase<Q,R,T,B>>, CorsSetter<CorsSupportBase.Builder<Q,R,T,B>>
Builder for CorsSupportBase instances.
  • Constructor Details

    • Builder

      protected Builder()
  • Method Details

    • build

      public abstract T build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<Q,R>
      Returns:
      instance of the built type
    • config

      public B config(Config config)
      Merges CORS config information. Typically, the app or component will retrieve the provided Config instance from its own config.
      Parameters:
      config - the CORS config
      Returns:
      the updated builder
    • mappedConfig

      public B mappedConfig(Config config)
      Merges mapped CORS config information. Typically, the app or component will retrieve the provided Config instance from its own config.
      Parameters:
      config - the mapped CORS config information
      Returns:
      the updated builder
    • enabled

      public B enabled(boolean value)
      Sets whether CORS support should be enabled or not.
      Specified by:
      enabled in interface CorsSetter<Q>
      Parameters:
      value - whether to use CORS support
      Returns:
      updated builder
    • addCrossOrigin

      public B addCrossOrigin(String path, CrossOriginConfig crossOrigin)
      Adds cross origin information associated with a given path.
      Parameters:
      path - the path to which the cross origin information applies
      crossOrigin - the cross origin information
      Returns:
      updated builder
    • addCrossOrigin

      public B addCrossOrigin(CrossOriginConfig crossOrigin)
      Adds cross origin information associated with the default path.
      Parameters:
      crossOrigin - the cross origin information
      Returns:
      updated builder
    • name

      public B name(String name)
      Sets the name to be used for the CORS support instance.
      Parameters:
      name - name to use
      Returns:
      updated builder
    • allowOrigins

      public B allowOrigins(String... origins)
      Description copied from interface: CorsSetter
      Sets the allowOrigins.
      Specified by:
      allowOrigins in interface CorsSetter<Q>
      Parameters:
      origins - the origin value(s)
      Returns:
      updated setter
    • allowHeaders

      public B allowHeaders(String... allowHeaders)
      Description copied from interface: CorsSetter
      Sets the allow headers.
      Specified by:
      allowHeaders in interface CorsSetter<Q>
      Parameters:
      allowHeaders - the allow headers value(s)
      Returns:
      updated setter
    • exposeHeaders

      public B exposeHeaders(String... exposeHeaders)
      Description copied from interface: CorsSetter
      Sets the expose headers.
      Specified by:
      exposeHeaders in interface CorsSetter<Q>
      Parameters:
      exposeHeaders - the expose headers value(s)
      Returns:
      updated setter
    • allowMethods

      public B allowMethods(String... allowMethods)
      Description copied from interface: CorsSetter
      Sets the allow methods.
      Specified by:
      allowMethods in interface CorsSetter<Q>
      Parameters:
      allowMethods - the allow method value(s)
      Returns:
      updated setter
    • allowCredentials

      public B allowCredentials(boolean allowCredentials)
      Description copied from interface: CorsSetter
      Sets the allow credentials flag.
      Specified by:
      allowCredentials in interface CorsSetter<Q>
      Parameters:
      allowCredentials - the allow credentials flag
      Returns:
      updated setter
    • maxAgeSeconds

      public B maxAgeSeconds(long maxAgeSeconds)
      Description copied from interface: CorsSetter
      Sets the maximum age.
      Specified by:
      maxAgeSeconds in interface CorsSetter<Q>
      Parameters:
      maxAgeSeconds - the maximum age
      Returns:
      updated setter
    • secondaryLookupSupplier

      protected B secondaryLookupSupplier(Supplier<Optional<CrossOriginConfig>> secondaryLookupSupplier)
      Not for developer use. Sets a back-up way to provide a CrossOriginConfig instance if, during look-up for a given request, none is found from the aggregator.
      Parameters:
      secondaryLookupSupplier - supplier of a CrossOriginConfig
      Returns:
      updated builder
    • requestDefaultBehaviorIfNone

      protected B requestDefaultBehaviorIfNone()