Package com.prowidesoftware.swift.utils
Class ResolverUtils
- java.lang.Object
-
- com.prowidesoftware.swift.utils.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 typesstatic 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 typesstatic 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 typesstatic 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 typesstatic int
findFirstWantedTypePosition(java.lang.String pattern, char type)
Returns the position of the first component based on the Types Pattern string and the wanted typesstatic 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 typesstatic 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 typesstatic 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 typesstatic 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 typesstatic 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 typestatic 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
-
-
-
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_PATTERNtypes
- a string with the wanted typescomponents
- 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_PATTERNtypes
- a string with the wanted typescomponents
- 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_PATTERNtypes
- the wanted typescomponents
- 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_PATTERNtypes
- the wanted typescomponents
- 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_PATTERNtype
- the wanted typecomponents
- 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_PATTERNtype
- the string listcomponents
- 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_PATTERNtype
- the wanted typecomponents
- 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_PATTERNtype
- the wanted typecomponents
- 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_PATTERNtypes
- 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_PATTERNtype
- 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_PATTERNtype
- the string list- Returns:
- the number of the first component that match any of the wanted types. Positions are 1 based
-
-