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

com.espertech.esper.epl.enummethod.dot.PropertyExprEvaluatorNonLambda Maven / Gradle / Ivy

Go to download

Complex event processing and event series analysis component

There is a newer version: 7.1.0
Show newest version
package com.espertech.esper.epl.enummethod.dot;

import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.EventPropertyGetter;
import com.espertech.esper.epl.expression.ExprEvaluator;
import com.espertech.esper.epl.expression.ExprEvaluatorContext;
import com.espertech.esper.epl.expression.ExprValidationException;

import java.util.Map;

public class PropertyExprEvaluatorNonLambda implements ExprEvaluator {

    private final int streamId;
    private final EventPropertyGetter getter;
    private final Class returnType;

    public PropertyExprEvaluatorNonLambda(int streamId, EventPropertyGetter getter, Class returnType) {
        this.streamId = streamId;
        this.getter = getter;
        this.returnType = returnType;
    }

    public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) {
        EventBean eventInQuestion = eventsPerStream[streamId];
        if (eventInQuestion == null) {
            return null;
        }
        return getter.get(eventInQuestion);
    }

    public Class getType() {
        return returnType;
    }

    public Map getEventType() throws ExprValidationException {
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy