Class AllowDenyCollectionManager<T>

  • Type Parameters:
    T - Collection generic type

    public final class AllowDenyCollectionManager<T>
    extends java.lang.Object
    Class for managing Allow / Deny collections and its predicates.
    Since:
    28/12/20
    Author:
    Tomaz Fernandes
    • Constructor Detail

      • AllowDenyCollectionManager

        public AllowDenyCollectionManager​(java.util.Collection<T> allowList,
                                          java.util.Collection<T> denyList)
      • AllowDenyCollectionManager

        public AllowDenyCollectionManager​(java.util.Collection<T> allowList,
                                          java.util.Collection<T> denyList,
                                          java.util.Collection<java.util.function.Predicate<T>> predicates)
    • Method Detail

      • getDefaultPredicate

        public java.util.function.Predicate<T> getDefaultPredicate​(java.util.Collection<T> allowList,
                                                                   java.util.Collection<T> denyList)
      • isAllowed

        public boolean isAllowed​(T objectToCheck)
      • areAllowed

        public boolean areAllowed​(T[] objects)
      • createManagerFor

        public static <T> AllowDenyCollectionManager<T> createManagerFor​(java.util.Collection<T> allowList,
                                                                         java.util.Collection<T> denyList)
      • createManagerFor

        public static <T> AllowDenyCollectionManager<T> createManagerFor​(java.util.Collection<T> allowList,
                                                                         java.util.Collection<T> denyList,
                                                                         java.util.Collection<java.util.function.Predicate<T>> predicates)
      • hasNoRestrictions

        public boolean hasNoRestrictions()