java.lang.Object
io.helidon.common.configurable.AllowList
- All Implemented Interfaces:
RuntimeType.Api<AllowListConfig>
,Predicate<String>
public class AllowList
extends Object
implements Predicate<String>, RuntimeType.Api<AllowListConfig>
AllowList
defines a list of allowed and/or denied matches and tests if a particular value conforms to
the conditions.
The algorithm of testing that a value is allowed:
- Iterate through all allowed patterns, if none matches, value is not permitted
- Iterate through all denied patterns, if any matches, value is not permitted
- Value is permitted
-
Method Summary
Modifier and TypeMethodDescriptionstatic AllowListConfig.Builder
builder()
Create a fluent API builder to configure an instance.static AllowList
CreateAllowList
from configurtion.static AllowList
create
(AllowListConfig config) Create a new allow list based on its configuration.static AllowList
create
(Consumer<AllowListConfig.Builder> consumer) Create a new allow list customizing its configuration.The prototype as it was received when creating this runtime object instance.boolean
Test whether a value can be permitted.toString()
-
Method Details
-
builder
Create a fluent API builder to configure an instance.- Returns:
- a new builder
-
create
CreateAllowList
from configurtion.- Parameters:
config
- configuration- Returns:
- a new configured
AllowList
-
create
Create a new allow list based on its configuration.- Parameters:
config
- configuration- Returns:
- a new allow list
-
create
Create a new allow list customizing its configuration.- Parameters:
consumer
- configuration consumer- Returns:
- a new allow list
-
prototype
Description copied from interface:RuntimeType.Api
The prototype as it was received when creating this runtime object instance.- Specified by:
prototype
in interfaceRuntimeType.Api<AllowListConfig>
- Returns:
- prototype object used to create this instance
-
test
Test whether a value can be permitted. -
toString
-