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

com.orange.cepheus.cep.model.Event Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
/*
 * Copyright (C) 2015 Orange
 *
 * This software is distributed under the terms and conditions of the 'GNU GENERAL PUBLIC LICENSE
 * Version 2' license which can be found in the file 'LICENSE.txt' in this package distribution or
 * at 'http://www.gnu.org/licenses/gpl-2.0-standalone.html'.
 */

package com.orange.cepheus.cep.model;

import java.util.HashMap;
import java.util.Map;

/**
 * Event sent to the Esper CEP engine.
 * An event is a collection of properties defined by a type.
 */
public class Event {

    private Map values;
    private String type;

    public Event() {
    }

    public Event(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void addValue(String name, Object value) {
        if (values == null) {
            values = new HashMap<>();
        }
        values.put(name, value);
    }

    public Map getValues() {
        return values;
    }

    @Override public String toString() {
        return "Event{" +
                "type='" + type + '\'' +
                ", values=" + values +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy