java.lang.Object
io.helidon.common.configurable.AllowList
All Implemented Interfaces:
RuntimeType.Api<io.helidon.common.configurable.AllowListConfig>, Predicate<String>

public class AllowList extends Object implements Predicate<String>, RuntimeType.Api<io.helidon.common.configurable.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:

  1. Iterate through all allowed patterns, if none matches, value is not permitted
  2. Iterate through all denied patterns, if any matches, value is not permitted
  3. Value is permitted
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.helidon.common.configurable.AllowListConfig.Builder
    Create a fluent API builder to configure an instance.
    static AllowList
    create(Config config)
    Create AllowList from configurtion.
    static AllowList
    create(io.helidon.common.configurable.AllowListConfig config)
    Create a new allow list based on its configuration.
    static AllowList
    create(Consumer<io.helidon.common.configurable.AllowListConfig.Builder> consumer)
    Create a new allow list customizing its configuration.
    io.helidon.common.configurable.AllowListConfig
    The prototype as it was received when creating this runtime object instance.
    boolean
    test(String value)
    Test whether a value can be permitted.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Method Details

    • builder

      public static io.helidon.common.configurable.AllowListConfig.Builder builder()
      Create a fluent API builder to configure an instance.
      Returns:
      a new builder
    • create

      public static AllowList create(Config config)
      Create AllowList from configurtion.
      Parameters:
      config - configuration
      Returns:
      a new configured AllowList
    • create

      public static AllowList create(io.helidon.common.configurable.AllowListConfig config)
      Create a new allow list based on its configuration.
      Parameters:
      config - configuration
      Returns:
      a new allow list
    • create

      public static AllowList create(Consumer<io.helidon.common.configurable.AllowListConfig.Builder> consumer)
      Create a new allow list customizing its configuration.
      Parameters:
      consumer - configuration consumer
      Returns:
      a new allow list
    • prototype

      public io.helidon.common.configurable.AllowListConfig prototype()
      Description copied from interface: RuntimeType.Api
      The prototype as it was received when creating this runtime object instance.
      Specified by:
      prototype in interface RuntimeType.Api<io.helidon.common.configurable.AllowListConfig>
      Returns:
      prototype object used to create this instance
    • test

      public boolean test(String value)
      Test whether a value can be permitted.
      Specified by:
      test in interface Predicate<String>
      Parameters:
      value - value to test against
      Returns:
      true if the value is allowed, false if it is not allowed or it is explicitly denied
    • toString

      public String toString()
      Overrides:
      toString in class Object