public class ParameterMappingFunctions extends Object
| Modifier and Type | Method and Description |
|---|---|
static Function<String,String> |
createClassNameListMapper(Collection<Class<?>> validClasses)
Creates a mapping function that forwards an input string if it is a simple class name
of a specified collection.
|
static <V> Function<String,V> |
createMapperForETL(Function<String,V> originalMappingFunction,
AbstractETL<?,?> etl)
Creates a mapping function that executes another mapping function while throwing an exception if a specified ETL
is currently busy.
|
static <V> Function<String,V> |
createMapperForETLs(Function<String,V> originalMappingFunction)
Creates a mapping function that executes another mapping function while throwing an exception if any ETL
is currently busy.
|
static Function<String,String> |
createStringListMapper(Collection<String> validValues)
Creates a mapping function that forwards input string values to the output only if they are
in a collection of valid values or if the input values are null.
|
static Boolean |
mapToBoolean(String value)
This function checks if a string represents a boolean value and throws an
exception if it does not.
|
static Integer |
mapToInteger(String value)
This function checks if a string represents an Integer value and throws an
exception if it does not.
|
static String |
mapToNonEmptyString(String value)
This function checks if the string value is neither null nor empty and throws
an exception if this check fails.
|
static String |
mapToString(String value)
This function simply forwards the string parameter that was passed to it.
|
static Integer |
mapToUnsignedInteger(String value)
This function checks if a string represents a positive Integer value and throws an
exception if it does not.
|
static String |
mapToUrlString(String value)
This function checks if a string represents a valid URL and returns the value if it does.
|
public static String mapToString(String value)
value - a string valuepublic static String mapToNonEmptyString(String value) throws IllegalArgumentException
value - a string valueIllegalArgumentException - if the value is null or emptypublic static Boolean mapToBoolean(String value) throws ClassCastException
value - a string representation of a parameter valueClassCastException - this exception is thrown when the String value cannot be mapped to the target valuepublic static Integer mapToInteger(String value) throws ClassCastException
value - a string representation of a parameter valueClassCastException - this exception is thrown when the String value cannot be mapped to the target valuepublic static Integer mapToUnsignedInteger(String value) throws ClassCastException
value - a string representation of a parameter valueClassCastException - this exception is thrown when the String value cannot be mapped to the target valuepublic static String mapToUrlString(String value) throws IllegalArgumentException
value - a string representation of a parameter valueIllegalArgumentException - this exception is thrown when the string does not represent a valid URLpublic static <V> Function<String,V> createMapperForETL(Function<String,V> originalMappingFunction, AbstractETL<?,?> etl)
V - the type of the parameter valueoriginalMappingFunction - the mapping function that is to be extendedetl - the AbstractETL of which the status is to be checkedpublic static <V> Function<String,V> createMapperForETLs(Function<String,V> originalMappingFunction)
V - the type of the parameter valueoriginalMappingFunction - the mapping function that is to be extendedpublic static Function<String,String> createStringListMapper(Collection<String> validValues)
validValues - a collection of allowed string valuespublic static Function<String,String> createClassNameListMapper(Collection<Class<?>> validClasses)
validClasses - a list of allowed class namesCopyright © 2017–2019. All rights reserved.