Class BeanUtils

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

public class BeanUtils
extends java.lang.Object
Set of Bean utilities.
  • Constructor Summary

    Constructors
    Constructor Description
    BeanUtils()  
  • Method Summary

    Modifier and Type Method Description
    Converter getPrimitiveTypeConverter()
    Returns a primitive type converter.
    BeanTransformer getTransformer()
    Returns a Bean Transformer.
    static <T,​ K> java.util.function.Function<T,​K> getTransformer​(BeanTransformer beanTransformer, java.lang.Class<K> targetClass)
    Returns a function that transforms an object T in an object K.
    static <T,​ K> java.util.function.Function<T,​K> getTransformer​(java.lang.Class<K> targetClass)
    Returns a function that transforms an object T in an object K.
    Validator getValidator()
    Returns a Bean Validator.

    Methods inherited from class java.lang.Object

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

    • BeanUtils

      public BeanUtils()
  • Method Details

    • getTransformer

      public static <T,​ K> java.util.function.Function<T,​K> getTransformer​(java.lang.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:
      java.lang.IllegalArgumentException - if any parameter is invalid
    • getTransformer

      public static <T,​ K> java.util.function.Function<T,​K> getTransformer​(BeanTransformer beanTransformer, java.lang.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:
      java.lang.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.