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

io.swagger.models.auth.In Maven / Gradle / Ivy

There is a newer version: 2.0.0-rc2
Show newest version
package io.swagger.models.auth;

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

import java.util.LinkedHashMap;
import java.util.Map;

public enum In {
    HEADER, QUERY;

    private static Map names = new LinkedHashMap();

    @JsonCreator
    public static In forValue(String value) {
        return names.get(value.toLowerCase());
    }

    @JsonValue
    public String toValue() {
        for (Map.Entry entry : names.entrySet()) {
            if (entry.getValue() == this) {
                return entry.getKey();
            }
        }

        return null; // or fail
    }

    static {
        names.put("header", HEADER);
        names.put("query", QUERY);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy