public static <T> Decorator<T> decorate(T delegate, Map<String, Function<T, Object>> mappings, String delegateKey,
            Configuration configuration) {
        return IterableDecorator.isIterable(delegate)
                ? new IterableDecorator<>(delegate, ImmutableMap.copyOf(mappings), delegateKey, configuration)
                : new Decorator<>(delegate, ImmutableMap.copyOf(mappings), delegateKey, configuration);
    }
public static <T> Decorator<T> decorate(T delegate, Map<String, Function<T, Object>> mappings, String delegateKey,
            Configuration configuration) {
        return IterableDecorator.isIterable(delegate)
                ? new IterableDecorator<>(delegate, ImmutableMap.copyOf(mappings), delegateKey, configuration)
                : new Decorator<>(delegate, ImmutableMap.copyOf(mappings), delegateKey, configuration);
    }
public static < T > Decorator < T > decorate ( T delegate , Map < String , Function < T , Object > > mappings , String delegateKey , Configuration configuration ) { return IterableDecorator . isIterable ( delegate ) ? new IterableDecorator <> ( delegate , ImmutableMap . copyOf ( mappings ) , delegateKey , configuration ) : new Decorator <> ( delegate , ImmutableMap . copyOf ( mappings ) , delegateKey , configuration ) ; }
Returns a decorator instance for the specified delegate and mappings.

@param delegate
@param mappings
@param delegateKey
May be null
@param configuration
@return a new decorator instance
Returns a decorator instance for the specified delegate and mappings .