Class ResolverUtils


  • public class ResolverUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ResolverUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String findFirstNonNullWantedType​(java.lang.String pattern, char type, java.util.List<java.lang.String> components)
      Returns the first NON-NULL component based on the Types Pattern string and the wanted types
      static org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String> findFirstNonNullWantedType​(java.lang.String pattern, java.lang.String types, java.util.List<java.lang.String> components)
      Returns the first NON-NULL component based on the Types Pattern string and the wanted types
      static java.lang.String findFirstWantedType​(java.lang.String pattern, char type, java.util.List<java.lang.String> components)
      Returns the first component based on the Types Pattern string and the wanted types
      static org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String> findFirstWantedType​(java.lang.String pattern, java.lang.String types, java.util.List<java.lang.String> components)
      Returns the first component based on the Types Pattern string and the wanted types
      static int findFirstWantedTypePosition​(java.lang.String pattern, char type)
      Returns the position of the first component based on the Types Pattern string and the wanted types
      static java.util.List<java.lang.String> findNonNullWantedType​(java.lang.String pattern, char type, java.util.List<java.lang.String> components)
      Returns a subset of NON-NULL components based on the Types Pattern string and the wanted types
      static java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String>> findNonNullWantedType​(java.lang.String pattern, java.lang.String types, java.util.List<java.lang.String> components)
      Returns a subset of components based on the Types Pattern string and the wanted types
      static java.util.List<java.lang.String> findWantedType​(java.lang.String pattern, char type, java.util.List<java.lang.String> components)
      Returns a subset of components based on the Types Pattern string and the wanted types
      static java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String>> findWantedType​(java.lang.String pattern, java.lang.String types, java.util.List<java.lang.String> components)
      Returns a subset of components based on the Types Pattern string and the wanted types
      static java.util.List<java.lang.Integer> findWantedTypesPosition​(java.lang.String pattern, char type)
      Returns the positions of the components based on the Types Pattern string and the wanted type
      static java.util.List<java.lang.Integer> findWantedTypesPosition​(java.lang.String pattern, java.lang.String types)
      Returns the positions of the components based on the Types Pattern string and the wanted types
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResolverUtils

        public ResolverUtils()
    • Method Detail

      • findWantedType

        public static java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String>> findWantedType​(java.lang.String pattern,
                                                                                                                                     java.lang.String types,
                                                                                                                                     java.util.List<java.lang.String> components)
        Returns a subset of components based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        types - a string with the wanted types
        components - the list of component values
        Returns:
        the list of pairs {type, value} that match any of the wanted types, including nulls
      • findNonNullWantedType

        public static java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String>> findNonNullWantedType​(java.lang.String pattern,
                                                                                                                                            java.lang.String types,
                                                                                                                                            java.util.List<java.lang.String> components)
        Returns a subset of components based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        types - a string with the wanted types
        components - the list of component values
        Returns:
        the list of pairs {type, value} that match any of the wanted types, including nulls
      • findFirstWantedType

        public static org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String> findFirstWantedType​(java.lang.String pattern,
                                                                                                                          java.lang.String types,
                                                                                                                          java.util.List<java.lang.String> components)
        Returns the first component based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        types - the wanted types
        components - the list of component values
        Returns:
        a pair containing the first NON-NULL component's type and the value
      • findFirstNonNullWantedType

        public static org.apache.commons.lang3.tuple.Pair<java.lang.Character,​java.lang.String> findFirstNonNullWantedType​(java.lang.String pattern,
                                                                                                                                 java.lang.String types,
                                                                                                                                 java.util.List<java.lang.String> components)
        Returns the first NON-NULL component based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        types - the wanted types
        components - the list of component values
        Returns:
        a pair containing the first NON-NULL component's type and the value
      • findWantedType

        public static java.util.List<java.lang.String> findWantedType​(java.lang.String pattern,
                                                                      char type,
                                                                      java.util.List<java.lang.String> components)
        Returns a subset of components based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        type - the wanted type
        components - the list of component values
        Returns:
        the list of components that match any of the wanted types, including nulls
      • findNonNullWantedType

        public static java.util.List<java.lang.String> findNonNullWantedType​(java.lang.String pattern,
                                                                             char type,
                                                                             java.util.List<java.lang.String> components)
        Returns a subset of NON-NULL components based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        type - the string list
        components - the list of component values
        Returns:
        the list of components that match any of the wanted types, NOT including nulls
      • findFirstWantedType

        public static java.lang.String findFirstWantedType​(java.lang.String pattern,
                                                           char type,
                                                           java.util.List<java.lang.String> components)
        Returns the first component based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        type - the wanted type
        components - the list of component values
        Returns:
        the value of the component that match any of the wanted types, CAN BE NULL
      • findFirstNonNullWantedType

        public static java.lang.String findFirstNonNullWantedType​(java.lang.String pattern,
                                                                  char type,
                                                                  java.util.List<java.lang.String> components)
        Returns the first NON-NULL component based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        type - the wanted type
        components - the list of component values
        Returns:
        the value of the component that match any of the wanted types, CANNOT BE NULL
      • findWantedTypesPosition

        public static java.util.List<java.lang.Integer> findWantedTypesPosition​(java.lang.String pattern,
                                                                                java.lang.String types)
        Returns the positions of the components based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        types - the list of requested types
        Returns:
        the list of components that have the requested types. Positions are 1 based
      • findWantedTypesPosition

        public static java.util.List<java.lang.Integer> findWantedTypesPosition​(java.lang.String pattern,
                                                                                char type)
        Returns the positions of the components based on the Types Pattern string and the wanted type
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        type - the requested type
        Returns:
        the list of components that have the requested types. Positions are 1 based
      • findFirstWantedTypePosition

        public static int findFirstWantedTypePosition​(java.lang.String pattern,
                                                      char type)
        Returns the position of the first component based on the Types Pattern string and the wanted types
        Parameters:
        pattern - the Types Pattern as indicated in member TYPES_PATTERN
        type - the string list
        Returns:
        the number of the first component that match any of the wanted types. Positions are 1 based