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

com.yahoo.security.tls.CapabilityMode Maven / Gradle / Ivy

There is a newer version: 8.411.13
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.security.tls;

import java.util.Arrays;

/**
 * @author bjorncs
 */
public enum CapabilityMode {
    DISABLE("disable"), LOG_ONLY("log_only"), ENFORCE("enforce");

    private final String configValue;

    CapabilityMode(String configValue) { this.configValue = configValue; }

    public String configValue() { return configValue; }

    /** @return Default value when mode is not explicitly specified */
    public static CapabilityMode defaultValue() { return DISABLE; }

    public static CapabilityMode fromConfigValue(String configValue) {
        return Arrays.stream(values())
                .filter(c -> c.configValue.equals(configValue))
                .findFirst().orElseThrow(() -> new IllegalArgumentException("Unknown value: " + configValue));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy