Class DFTermExpressions


  • public final class DFTermExpressions
    extends java.lang.Object
    Utility class for DFTermExpression.
    Since:
    17.1.9
    • Field Detail

      • FILTER_CHILD_DATA

        public static final java.lang.String FILTER_CHILD_DATA
        See Also:
        Constant Field Values
    • Method Detail

      • getField

        public static DFField getField​(DFTermExpression expr)
        Extracts field from expression.
        Parameters:
        expr - The expression.
        Returns:
        The field used in expression, can be null.
      • getEntity

        public static DFEntity getEntity​(DFTermExpression expr)
        Extracts entity from expression.
        Parameters:
        expr - The expression.
        Returns:
        The entity used in expression, can be null.
      • filterOperands

        public static <T extends DFTerm> java.util.List<T> filterOperands​(DFTermExpression expr,
                                                                          java.lang.Class<T> clazz)
        Returns the list operands with defined type.
        Type Parameters:
        T - The type of operands.
        Parameters:
        expr - The expression.
        clazz - The class to return.
        Returns:
        List of operands with the defined type.
      • getValues

        public static java.util.List<java.lang.Object> getValues​(DFTermExpression expr)
        Returns the values from the expression.
        Parameters:
        expr - The expression.
        Returns:
        List of values defined in expression.
      • getValues

        public static java.util.List<java.lang.Object> getValues​(DFTermExpression expr,
                                                                 DFDataConvertor convertor)
        Returns the values from the expression converted with the convertor.
        Parameters:
        expr - The expression.
        convertor - Convertor used to convert the data.
        Returns:
        List of values defined in expression.
      • isLogical

        public static boolean isLogical​(DFTermExpression expr)
        Returns if the expression is logical.
        Parameters:
        expr - The expression
        Returns:
        True if the operator used in expression is logical (AND or OR).
      • isCountStar

        public static boolean isCountStar​(DFTermExpression expr)
        Returns if the expression is COUNT(*).
        Parameters:
        expr - The expression.
        Returns:
        True if the expression is COUNT(*).
      • isFilterChildData

        public static boolean isFilterChildData​(DFTermExpression query,
                                                DFDataTree dataTree)
        Tells if filtering child data feature is on or off for given query.
        Parameters:
        query - the query
        dataTree - the data tree where the query belongs
        Returns:
        true if filtering is enabled on the given query.
        Since:
        19.20.0
        See Also:
        DFResultSet.isFilterSearchResults()
      • isLoadAllConvergentData

        public static boolean isLoadAllConvergentData​(DFTermExpression query,
                                                      DFDataTree dataTree)
        Tells if loading all convergent child data feature is on or off for given query.
        Parameters:
        query - the query
        dataTree - the data tree where the query belongs
        Returns:
        true if loading is enabled on the given query.
        Since:
        19.20.0
        See Also:
        DFResultSet.isLoadAllChildRows()
      • putOptions

        public static DFTermExpression putOptions​(DFTermExpression query,
                                                  java.util.Map<java.lang.String,​java.lang.Object> options)
        Adds given options to the given query. If an option already exists, it is overwritten.
        Parameters:
        query - the query
        options - new options to add or overwrite
        Returns:
        changed query
        Since:
        19.20.0