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

io.getunleash.Unleash Maven / Gradle / Ivy

There is a newer version: 9.2.4
Show newest version
package io.getunleash;

import java.util.List;
import java.util.function.BiFunction;

public interface Unleash {
    boolean isEnabled(String toggleName);

    boolean isEnabled(String toggleName, boolean defaultSetting);

    default boolean isEnabled(String toggleName, UnleashContext context) {
        return isEnabled(toggleName, context, false);
    }

    default boolean isEnabled(String toggleName, UnleashContext context, boolean defaultSetting) {
        return isEnabled(toggleName, defaultSetting);
    }

    default boolean isEnabled(
            String toggleName, BiFunction fallbackAction) {
        return isEnabled(toggleName, false);
    }

    default boolean isEnabled(
            String toggleName,
            UnleashContext context,
            BiFunction fallbackAction) {
        return isEnabled(toggleName, context, false);
    }

    Variant getVariant(final String toggleName, final UnleashContext context);

    Variant getVariant(
            final String toggleName, final UnleashContext context, final Variant defaultValue);

    Variant getVariant(final String toggleName);

    Variant getVariant(final String toggleName, final Variant defaultValue);

    /**
     * Use more().getFeatureToggleNames() instead
     *
     * @return a list of known toggle names
     */
    @Deprecated()
    List getFeatureToggleNames();

    default void shutdown() {}

    MoreOperations more();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy