Interface Transformer<N extends Transformer>

Type Parameters:
N - the Transformer implementation.
All Known Subinterfaces:
BeanTransformer, MapTransformer
All Known Implementing Classes:
AbstractTransformer, MapTransformerImpl, TransformerImpl

public interface Transformer<N extends Transformer>
Utility methods for all objects transformation.
  • Method Details

    • withFieldMapping

      N withFieldMapping​(FieldMapping... fieldMapping)
      Initializes the mapping between fields in the source object and the destination one.
      Parameters:
      fieldMapping - the field mapping
      Returns:
      the Transformer instance
    • removeFieldMapping

      void removeFieldMapping​(java.lang.String destFieldName)
      Removes the field mapping for the given field.
      Parameters:
      destFieldName - the field name in the destination object
    • resetFieldsMapping

      void resetFieldsMapping()
      Removes all the configured fields mapping.
    • withFieldTransformer

      N withFieldTransformer​(FieldTransformer... fieldTransformer)
      Initializes the field transformer functions. The transformer function returns directly the field value.
      Parameters:
      fieldTransformer - the fields transformer function
      Returns:
      the Transformer instance
    • removeFieldTransformer

      void removeFieldTransformer​(java.lang.String destFieldName)
      Removes the field transformer for the given field.
      Parameters:
      destFieldName - the field name in the destination object
    • resetFieldsTransformer

      void resetFieldsTransformer()
      Removes all the configured fields transformer.