Class BeanUtils

java.lang.Object
com.hotels.beans.BeanUtils

public class BeanUtils
extends Object
Set of Bean utilities.
  • Constructor Details

    • BeanUtils

      public BeanUtils()
  • Method Details

    • 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 type
      K - 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​(BeanTransformer beanTransformer, Class<K> targetClass)
      Returns a function that transforms an object T in an object K.
      Type Parameters:
      T - the Source object type
      K - the target object type
      Parameters:
      beanTransformer - the transformer to be used.
      targetClass - the destination object
      Returns:
      a function that copies of the source object into the destination object
      Throws:
      IllegalArgumentException - if any parameter is invalid
    • getTransformer

      public final BeanTransformer getTransformer()
      Returns a Bean Transformer.
      Returns:
      a BeanTransformer instance.
    • getValidator

      public final Validator getValidator()
      Returns a Bean Validator.
      Returns:
      a Bean Validator instance.
    • getPrimitiveTypeConverter

      public final Converter getPrimitiveTypeConverter()
      Returns a primitive type converter.
      Returns:
      a Converter instance.