Class MappedCrossOriginConfig

java.lang.Object
io.helidon.cors.MappedCrossOriginConfig
All Implemented Interfaces:
Iterable<Map.Entry<String,CrossOriginConfig>>

public class MappedCrossOriginConfig extends Object implements Iterable<Map.Entry<String,CrossOriginConfig>>
Cross-origin CrossOriginConfig instances linked to paths, plus an enabled setting. Most developers will not need to use this directly from their applications.
  • Method Details

    • builder

      public static MappedCrossOriginConfig.Builder builder()
      Returns a new builder for creating a CrossOriginConfig.Mapped instance.
      Returns:
      the new builder
    • builder

      public static MappedCrossOriginConfig.Builder builder(Config config)
      Creates a new Mapped.Builder instance using the provided configuration.

      Although this method is equivalent to builder().config(config) it conveniently combines those two steps for use as a method reference.

      Parameters:
      config - node containing Mapped cross-origin information
      Returns:
      new Mapped.Builder based on the config
    • create

      public static MappedCrossOriginConfig create(Config config)
      Creates a new Mapped instance using the provided configuration.
      Parameters:
      config - node containing Mapped cross-origin information
      Returns:
      new Mapped instance based on the config
    • iterator

      Specified by:
      iterator in interface Iterable<Map.Entry<String,CrossOriginConfig>>
    • forEach

      public void forEach(BiConsumer<String,CrossOriginConfig> consumer)
      Invokes the specified consumer for each entry in the mapped CORS config.
      Parameters:
      consumer - accepts the path and the CrossOriginConfig for processing
    • get

      public CrossOriginConfig get(String pathPattern)
      Finds the CrossOriginConfig associated with the given path expression, if any.
      Parameters:
      pathPattern - path expression to match on
      Returns:
      Optional of the corresponding basic cross-origin information
    • name

      public String name()
      Returns:
      the name set up for this CORS-enabled component or app
    • isEnabled

      public boolean isEnabled()
      Reports whether this instance is enabled.
      Returns:
      current enabled state
    • toString

      public String toString()
      Overrides:
      toString in class Object