Class LanguageUtil


  • public final class LanguageUtil
    extends Object
    Helpful utility methods to work with language interfaces.
    • Method Detail

      • separateCriteriaByAnd

        public static final List<Condition> separateCriteriaByAnd​(Condition criteria)
        Take a criteria, which may be null, a single IPredicateCriteria or a complex criteria built using ICompoundCriteria and breaks it apart at ANDs such that a List of ICriteria conjuncts are returned. For example, ((a=1 OR b=2) AND (c=3 AND d=4)) would return the list (a=1 OR b=2), c=3, d=4. If criteria is null, an empty list is returned.
        Parameters:
        criteria - Criteria to break, may be null
        Returns:
        List of ICriteria, never null
      • combineCriteria

        public static Condition combineCriteria​(Condition primaryCrit,
                                                Condition additionalCrit,
                                                LanguageFactory languageFactory)
        This utility method can be used to combine two criteria using an AND. If both criteria are null, then null will be returned. If either is null, then the other will be returned.
        Parameters:
        primaryCrit - Primary criteria - may be modified
        additionalCrit - Won't be modified, but will likely be attached to the returned crit
        languageFactory - Will be used to construct new ICompoundCriteria if necessary
        Returns:
        Combined criteria
      • combineCriteria

        public static Condition combineCriteria​(List<Condition> crits)
        Combines a list of conditions under a single AndOr
        Parameters:
        crits -
        Returns: