Class PolicyUtils


  • public final class PolicyUtils
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean contains​(Collection<org.apache.neethi.Assertion> assertions, Collection<org.apache.neethi.Assertion> candidates)
      Determine if one collection of assertions contains another collection of assertion, using the equal method from the Assertion interface.
      static boolean contains​(Collection<org.apache.neethi.Assertion> assertions, org.apache.neethi.Assertion candidate)
      Determine if a collection of assertions contains a given assertion, using the equal method from the Assertion interface.
      static Assertor createAsserter​(Object o)  
      static boolean isEmptyPolicy​(org.apache.neethi.Policy p)
      Checks if a given policy contains no policy components or if it has only empty ExactlyOne or All components containing no assertions
      static boolean isEmptyPolicyOperator​(org.apache.neethi.PolicyOperator p)
      Checks if a given policy operator has no policy components or if it has only empty ExactlyOne or All components containing no assertions
      static void logPolicy​(Logger log, Level level, String msg, org.apache.neethi.PolicyComponent pc)  
      static void printPolicyComponent​(org.apache.neethi.PolicyComponent pc)  
      static void printPolicyComponent​(org.apache.neethi.PolicyComponent pc, StringBuilder buf, int level)  
    • Method Detail

      • isEmptyPolicy

        public static boolean isEmptyPolicy​(org.apache.neethi.Policy p)
        Checks if a given policy contains no policy components or if it has only empty ExactlyOne or All components containing no assertions
        Parameters:
        p - the policy
        Returns:
        true if the policy is empty
      • isEmptyPolicyOperator

        public static boolean isEmptyPolicyOperator​(org.apache.neethi.PolicyOperator p)
        Checks if a given policy operator has no policy components or if it has only empty ExactlyOne or All components containing no assertions
        Parameters:
        p - the policy operator
        Returns:
        true if this policy operator is empty
      • contains

        public static boolean contains​(Collection<org.apache.neethi.Assertion> assertions,
                                       org.apache.neethi.Assertion candidate)
        Determine if a collection of assertions contains a given assertion, using the equal method from the Assertion interface.
        Parameters:
        assertions - a collection of assertions
        candidate - the assertion to test
        Returns:
        true iff candidate is equal to one of the assertions in the collection
      • contains

        public static boolean contains​(Collection<org.apache.neethi.Assertion> assertions,
                                       Collection<org.apache.neethi.Assertion> candidates)
        Determine if one collection of assertions contains another collection of assertion, using the equal method from the Assertion interface.
        Parameters:
        assertions - a collection of assertions
        candidates - the collections of assertion to test
        Returns:
        true iff each candidate is equal to one of the assertions in the collection
      • logPolicy

        public static void logPolicy​(Logger log,
                                     Level level,
                                     String msg,
                                     org.apache.neethi.PolicyComponent pc)
      • printPolicyComponent

        public static void printPolicyComponent​(org.apache.neethi.PolicyComponent pc)
      • printPolicyComponent

        public static void printPolicyComponent​(org.apache.neethi.PolicyComponent pc,
                                                StringBuilder buf,
                                                int level)
      • createAsserter

        public static Assertor createAsserter​(Object o)