All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mysema.query.collections.EvaluatorTransformer Maven / Gradle / Ivy

/*
 * Copyright (c) 2010 Mysema Ltd.
 * All rights reserved.
 *
 */
package com.mysema.query.collections;

import org.apache.commons.collections15.Transformer;

import com.mysema.codegen.Evaluator;

/**
 * Transformer implementation which uses and Evaluator for transformation
 * 
 * @author tiwe
 */
public class EvaluatorTransformer implements Transformer {

    private final Evaluator ev;

    public EvaluatorTransformer(Evaluator ev) {
        this.ev = ev;
    }

    @Override
    public T transform(S input) {
        if (input.getClass().isArray()){
            return ev.evaluate((Object[]) input);
        }else{
            return ev.evaluate(new Object[]{input});
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy