io.getunleash.ActivationStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unleash-client-java Show documentation
Show all versions of unleash-client-java Show documentation
A client library for Unleash
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;
}
}