- java.lang.Object
-
- io.helidon.webserver.cors.MappedCrossOriginConfig
-
- All Implemented Interfaces:
Iterable<Map.Entry<String,CrossOriginConfig>>
public class MappedCrossOriginConfig extends Object implements Iterable<Map.Entry<String,CrossOriginConfig>>
Cross-originCrossOriginConfig
instances linked to paths, plus anenabled
setting. Most developers will not need to use this directly from their applications.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MappedCrossOriginConfig.Builder
Fluent builder forMapped
cross-origin config.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MappedCrossOriginConfig.Builder
builder()
Returns a new builder for creating aCrossOriginConfig.Mapped
instance.static MappedCrossOriginConfig.Builder
builder(Config config)
Creates a newMapped.Builder
instance using the provided configuration.static MappedCrossOriginConfig
create(Config config)
Creates a newMapped
instance using the provided configuration.void
forEach(BiConsumer<String,CrossOriginConfig> consumer)
Invokes the specified consumer for each entry in the mapped CORS config.CrossOriginConfig
get(String pathPattern)
Finds theCrossOriginConfig
associated with the given path expression, if any.boolean
isEnabled()
Reports whether this instance is enabled.Iterator<Map.Entry<String,CrossOriginConfig>>
iterator()
String
name()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
builder
public static MappedCrossOriginConfig.Builder builder()
Returns a new builder for creating aCrossOriginConfig.Mapped
instance.- Returns:
- the new builder
-
builder
public static MappedCrossOriginConfig.Builder builder(Config config)
Creates a newMapped.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 containingMapped
cross-origin information- Returns:
- new
Mapped.Builder
based on the config
-
create
public static MappedCrossOriginConfig create(Config config)
Creates a newMapped
instance using the provided configuration.- Parameters:
config
- node containingMapped
cross-origin information- Returns:
- new
Mapped
instance based on the config
-
iterator
public Iterator<Map.Entry<String,CrossOriginConfig>> iterator()
- Specified by:
iterator
in interfaceIterable<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 theCrossOriginConfig
for processing
-
get
public CrossOriginConfig get(String pathPattern)
Finds theCrossOriginConfig
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
-
-