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

io.getunleash.ActivationStrategy Maven / Gradle / Ivy

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

import io.getunleash.lang.Nullable;
import java.util.*;

public final class ActivationStrategy {
    private final String name;
    private final Map parameters;
    private final List constraints;
    private final List segments;

    public ActivationStrategy(String name, @Nullable Map parameters) {
        this(name, parameters, Collections.emptyList(), Collections.emptyList());
    }

    public ActivationStrategy(
            String name,
            @Nullable Map parameters,
            List constraints,
            List segments) {
        this.name = name;
        this.parameters = Optional.ofNullable(parameters).orElseGet(Collections::emptyMap);
        this.constraints = Optional.ofNullable(constraints).orElseGet(Collections::emptyList);
        this.segments = Optional.ofNullable(segments).orElseGet(Collections::emptyList);
    }

    public String getName() {
        return name;
    }

    public List getSegments() {
        return segments;
    }

    public Map getParameters() {
        return parameters;
    }

    public List getConstraints() {
        return constraints;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy