Interface BeanValueTransformer<T>

Type Parameters:
T - the type of the bean
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BeanValueTransformer<T>
A BeanValueTransformer can be "inserted" into a BeanReader and BeanWriter to modify the value to be returned to the user by the BeanReader, or to be written to the bean by the BeanWriter.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> BeanValueTransformer<T>
    The no-op transformer.
    transform(T bean, String propertyName, Object propertyValue)
    Transforms the value just retrieved from a bean, or about to be set on a bean.
  • Method Details

    • identity

      static <T> BeanValueTransformer<T> identity()
      The no-op transformer. Returns the property value as-is.
      Type Parameters:
      T - the type of the bean
      Returns:
      the property value as-is
    • transform

      Object transform(T bean, String propertyName, Object propertyValue)
      Transforms the value just retrieved from a bean, or about to be set on a bean.
      Parameters:
      bean - the bean that was read or is about to be written
      propertyName - the name of the property that was read or is about to be written
      propertyValue - the original value
      Returns:
      the new value