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

net.aequologica.neo.shakuntala.Event Maven / Gradle / Ivy

There is a newer version: 0.6.7
Show newest version
package net.aequologica.neo.shakuntala;

import java.util.AbstractMap;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown=true)
public class Event {

    static public enum Level {
        success,
        info,
        warning,
        danger
     }

    final private Level level;

    @JsonIgnore
    final private Object object;
    
    @JsonIgnore
    final private AbstractMap.SimpleImmutableEntry internals; 

    public Event(
            @JsonProperty("key")    final String key,
            @JsonProperty("value")  final String value,
            @JsonProperty("level")  final Level  level,
            @JsonProperty("object") final Object object) {
        internals = new AbstractMap.SimpleImmutableEntry(key, value);
        this.object = object;
        this.level  = level;
    }

    public Event.Level getLevel() {
        return level;
    }

    @JsonIgnore
    public Object getObject() {
        return object;
    }

    public String getKey() {
        return internals.getKey();
    }

    public String getValue() {
        return internals.getValue();
    }

    public String setValue(String value) {
        return internals.setValue(value);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy