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

dev.fitko.fitconnect.api.domain.model.destination.StatusEnum Maven / Gradle / Ivy

Go to download

Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and routing

There is a newer version: 2.3.5
Show newest version
package dev.fitko.fitconnect.api.domain.model.destination;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

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

public enum StatusEnum {

    CREATED("created"),

    ACTIVE("active"),

    INACTIVE("inactive"),

    DECOMMISSIONED("decommissioned");

    private static final Map CONSTANTS = new HashMap<>();

    static {
        for (final StatusEnum c : values()) {
            CONSTANTS.put(c.value, c);
        }
    }

    private final String value;

    StatusEnum(final String value) {
        this.value = value;
    }

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

    @Override
    public String toString() {
        return String.valueOf(value);
    }

    @JsonCreator
    public static StatusEnum fromValue(final String value) {
        final StatusEnum constant = CONSTANTS.get(value);
        if (constant == null) {
            throw new IllegalArgumentException("Unexpected value '" + value + "'");
        }
        return constant;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy