Interface AllowList

All Superinterfaces:
Predicate<String>

public interface AllowList extends Predicate<String>
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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Fluent API builder for AllowList.
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a fluent API builder to configure an instance.
    static AllowList
    create(Config config)
    Create AllowList from configurtion.
    boolean
    test(String value)
    Test whether a value can be permitted.

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Method Details

    • builder

      static AllowList.Builder builder()
      Create a fluent API builder to configure an instance.
      Returns:
      a new builder
    • create

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

      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