

package org.xlcloud.openstack.model.climate;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author Krzysztof Szafrański, AMG.net
 */
@XmlType( name = "status" )
@XmlEnum
public enum EventType {

    @XmlEnumValue( "start_lease" )
    START("start_lease"),

    @XmlEnumValue( "end_lease" )
    END("end_lease"),

    OTHER("ohter");

    private final String value;

    EventType( String v ) {
        value = v;
    }

    @JsonValue
    public String value() {
        return value;
    }

    public static EventType fromValue(String v) {
        for (EventType c : EventType.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        return OTHER;
    }
}
