Class AbstractTransformer<T extends Transformer,​P,​S extends TransformerSettings<P>>

    • Field Detail

      • transformerFunctionRegex

        protected final java.lang.String transformerFunctionRegex
        A regex that returns all the transformer function cached items.
      • settings

        protected S extends TransformerSettings<P> settings
        Contains both the field name mapping and the lambda function to be applied on fields.
    • Constructor Detail

      • AbstractTransformer

        protected AbstractTransformer​(java.lang.String transformerFunctionCachePrefix,
                                      java.lang.String cacheName,
                                      S transformerSettings)
        Default constructor.
        Parameters:
        transformerFunctionCachePrefix - the cache key prefix for the Transformer Functions.
        cacheName - the cache key prefix for the transformer.
        transformerSettings - contains the transformer configuration.
    • Method Detail

      • withFieldMapping

        public final T withFieldMapping​(FieldMapping... fieldMapping)
        Initializes the mapping between fields in the source object and the destination one.
        Specified by:
        withFieldMapping in interface Transformer<T extends Transformer>
        Parameters:
        fieldMapping - the field mapping
        Returns:
        the Transformer instance
      • withFieldTransformer

        public final T withFieldTransformer​(FieldTransformer... fieldTransformer)
        Initializes the field transformer functions. The transformer function returns directly the field value.
        Specified by:
        withFieldTransformer in interface Transformer<T extends Transformer>
        Parameters:
        fieldTransformer - the fields transformer function
        Returns:
        the Transformer instance
      • removeFieldMapping

        public final void removeFieldMapping​(java.lang.String destFieldName)
        Removes the field mapping for the given field.
        Specified by:
        removeFieldMapping in interface Transformer<T extends Transformer>
        Parameters:
        destFieldName - the field name in the destination object
      • removeFieldTransformer

        public final void removeFieldTransformer​(java.lang.String destFieldName)
        Removes the field transformer for the given field.
        Specified by:
        removeFieldTransformer in interface Transformer<T extends Transformer>
        Parameters:
        destFieldName - the field name in the destination object
      • reset

        public final void reset()
        Removes all the configured settings.
        Specified by:
        reset in interface Transformer<T extends Transformer>