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

io.apicurio.registry.rest.v3.beans.IfArtifactExists Maven / Gradle / Ivy

There is a newer version: 3.0.4
Show newest version

package io.apicurio.registry.rest.v3.beans;

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

@io.quarkus.runtime.annotations.RegisterForReflection
public enum IfArtifactExists {

    FAIL("FAIL"),
    CREATE_VERSION("CREATE_VERSION"),
    FIND_OR_CREATE_VERSION("FIND_OR_CREATE_VERSION");
    private final String value;
    private final static Map CONSTANTS = new HashMap();

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

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

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

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy