Class ParametersUtil


  • public final class ParametersUtil
    extends Object
    Refactored the PopulateSearchParameterMap code, and marked class as final so there are no 'children' and inheritance which overwrites the behaviors of the buildInSearchParameters.
    Call init() before using the class in order to avoid a slight performance hit on first use.
    • Method Detail

      • init

        public static void init()
        Loads the class in the classloader to initialize static members. Call this before using the class in order to avoid a slight performance hit on first use.
      • buildSearchParametersMapFromBundle

        public static Map<String,​ParametersMap> buildSearchParametersMapFromBundle​(Bundle bundle)
        Builds a Map of ParameterMaps from the passed Bundle.
        Parameters:
        bundle - a Bundle of type Collection with entries of type SearchParameter
        Returns:
        a Map of ParameterMaps, keyed by resourceType
        Throws:
        ClassCastException - if the Bundle contains entries of any type other than SearchParameter
      • checkAndWarnForIssueWithCodeAndName

        static void checkAndWarnForIssueWithCodeAndName​(String code,
                                                        String name)
        checks and warns if name and code are not equivalent.
        Parameters:
        code -
        name -
      • getBuiltInSearchParametersMap

        public static Map<String,​ParametersMap> getBuiltInSearchParametersMap()
        Returns:
        a map of maps The outer map is keyed by resource type. The inner map is keyed by both SearchParameter.code and SearchParameter.url
      • print

        public static void print​(PrintStream out)
        convenience method to print the output of the Search Parameters.
        Parameters:
        out -
      • printSearchParameter

        public static void printSearchParameter​(SearchParameter parameter,
                                                PrintStream out)
        outputs the search parameter.
        Parameters:
        parameter -
        out -