Package com.hotels.beans
Class BeanUtils
- java.lang.Object
-
- com.hotels.beans.BeanUtils
-
public class BeanUtils extends Object
Set of Bean utilities.
-
-
Constructor Summary
Constructors Constructor Description BeanUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Converter
getPrimitiveTypeConverter()
Returns a primitive type converter.Transformer
getTransformer()
Returns a Bean Transformer.static <T,K>
Function<T,K>getTransformer(Transformer beanTransformer, Class<K> targetClass)
Returns a function that transforms an object T in an object K.static <T,K>
Function<T,K>getTransformer(Class<K> targetClass)
Returns a function that transforms an object T in an object K.Validator
getValidator()
Returns a Bean Validator.
-
-
-
Method Detail
-
getTransformer
public static <T,K> Function<T,K> getTransformer(Class<K> targetClass)
Returns a function that transforms an object T in an object K.- Type Parameters:
T
- the Source object typeK
- the target object type- Parameters:
targetClass
- the destination object class- Returns:
- a function that copies of the source object into the destination object
- Throws:
IllegalArgumentException
- if any parameter is invalid
-
getTransformer
public static <T,K> Function<T,K> getTransformer(Transformer beanTransformer, Class<K> targetClass)
Returns a function that transforms an object T in an object K.- Type Parameters:
T
- the Source object typeK
- the target object type- Parameters:
beanTransformer
- the transformer to be used.targetClass
- the destination object class- Returns:
- a function that copies of the source object into the destination object
- Throws:
IllegalArgumentException
- if any parameter is invalid
-
getTransformer
public final Transformer getTransformer()
Returns a Bean Transformer.- Returns:
- a
Transformer
instance.
-
getValidator
public final Validator getValidator()
Returns a Bean Validator.- Returns:
- a Bean Validator instance.
-
-