Class QueryUtils


  • public class QueryUtils
    extends Object
    Utility class providing methods for handling data queries
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getParameterValueArray

        public static final Serializable[] getParameterValueArray​(List<IParameterModel> parameters)
        Generates an array from the given list of parameters containing the parameter values
        Parameters:
        parameters - List of IParameterModels
        Returns:
        an array of the parameter values
      • replaceWithNumbers

        public static final String replaceWithNumbers​(String original,
                                                      String replaceString,
                                                      int start)
        replaces all occurrences of a given substring in the original String with running numbers
        Parameters:
        original - String that should be altered
        replaceString - String that should be replaced
        start - from where the running numbers should start
        Returns:
        String with replaced substrings
      • formatBold

        public static final String formatBold​(String original,
                                              String bold)
        Turns sub strings within the original bold
        Parameters:
        original - String
        bold - String to be made bold within the original string
        Returns:
        String of original with bold sub strings
      • getTreeNode

        public static final org.primefaces.model.TreeNode getTreeNode​(com.alibaba.fastjson.JSON json,
                                                                      Object data)
        Generates a TreeNode from the given JSON
        Parameters:
        json - JSON containing tree information
        Returns:
        TreeNode of the given JSON
      • getTreeNode

        public static final org.primefaces.model.TreeNode getTreeNode​(com.alibaba.fastjson.JSONArray jsonArray,
                                                                      Object data)
        Generates a TreeNode from the given JSONArray
        Parameters:
        jsonArray - JSONArray containing tree information
        Returns:
        TreeNode of the given JSONArray
      • getTreeNode

        public static final org.primefaces.model.TreeNode getTreeNode​(com.alibaba.fastjson.JSONObject jsonObject,
                                                                      Object data)
        Generates a TreeNode from the given JSONObject
        Parameters:
        jsonObject - JSONObject containing tree information
        Returns:
        TreeNode of the given JSONObject
      • setParamValues

        public static String setParamValues​(String original,
                                            String replaceStr,
                                            List<IParameterModel> params,
                                            boolean withQuotes)
        Replaces all occurrences of the placeholder with the consecutive values of the parameter list
        Parameters:
        original - String
        replaceStr - String to be replaced by the parameter values
        params - List parameter list containing values to be input into original string
        Returns:
        the String with replaces placeholder