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

no.nav.sbl.soknadsosialhjelp.soknad.common.JsonKilde Maven / Gradle / Ivy

There is a newer version: 1.2019.09.25-00.21-49b69f0625e0
Show newest version

package no.nav.sbl.soknadsosialhjelp.soknad.common;

import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public enum JsonKilde {

    BRUKER("bruker"),
    SYSTEM("system"),
    UTDATERT("utdatert");
    private final String value;
    private final static Map CONSTANTS = new HashMap();

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

    private JsonKilde(String value) {
        this.value = value;
    }

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

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

    @JsonCreator
    public static JsonKilde fromValue(String value) {
        JsonKilde constant = CONSTANTS.get(value);
        if (constant == null) {
            throw new IllegalArgumentException(value);
        } else {
            return constant;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy