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.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fluent builder forMapped
cross-origin config. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Returns a new builder for creating aCrossOriginConfig.Mapped
instance.Creates a newMapped.Builder
instance using the provided configuration.static MappedCrossOriginConfig
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.Finds theCrossOriginConfig
associated with the given path expression, if any.boolean
Reports whether this instance is enabled.iterator()
name()
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 Details
-
builder
Returns a new builder for creating aCrossOriginConfig.Mapped
instance.- Returns:
- the new builder
-
builder
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
Creates a newMapped
instance using the provided configuration.- Parameters:
config
- node containingMapped
cross-origin information- Returns:
- new
Mapped
instance based on the config
-
iterator
- Specified by:
iterator
in interfaceIterable<Map.Entry<String,
CrossOriginConfig>>
-
forEach
Invokes the specified consumer for each entry in the mapped CORS config.- Parameters:
consumer
- accepts the path and theCrossOriginConfig
for processing
-
get
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
- 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
-