Interface CorsConfig
- All Superinterfaces:
Comparable<Weighted>, Prototype.Api, Prototype.Factory<CorsFeature>, Weighted
- All Known Implementing Classes:
CorsConfig.BuilderBase.CorsConfigImpl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forCorsFeature.static classCorsConfig.BuilderBase<BUILDER extends CorsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CorsConfig>Fluent API builder base forCorsConfig. -
Field Summary
Fields inherited from interface Weighted
DEFAULT_WEIGHTModifier and TypeFieldDescriptionstatic final doubleDefault weight for any weighted component (whether it implements this interface or usesWeightannotation). -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether to add a default path configuration, that matches all paths,GET, HEAD, POSTmethods, and allows all origins, methods, and headers.static CorsConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static CorsConfig.Builderbuilder(CorsConfig instance) Create a new fluent API builder from an existing instance.static CorsConfigcreate()Create a new instance with default values.static CorsConfigCreate a new instance from configuration.booleanenabled()This feature can be disabled.name()Name of this instance.default List<CorsPathConfig> paths()Per path configuration.sockets()List of sockets to register this feature on.doubleweight()Weight of the CORS feature.Methods inherited from interface Prototype.Factory
buildModifier and TypeMethodDescriptionbuild()Create a new instance of the runtime type from this config object.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
-
weight
-
sockets
-
name
-
enabled
boolean enabled()This feature can be disabled. This feature is automatically enabled if there is at least onepaths()defined.- Returns:
- whether the feature is enabled
-
paths
Per path configuration. Default path is added, unlessaddDefaults()is set tofalse.- Returns:
- per path configurations
-
addDefaults
default boolean addDefaults()Whether to add a default path configuration, that matches all paths,GET, HEAD, POSTmethods, and allows all origins, methods, and headers. This is always added as a last path.- Returns:
- whether to add defaults as the last path, defaults to
true
-