org.kiwiproject.consul.option.EventOptions Maven / Gradle / Ivy
package org.kiwiproject.consul.option;
import static org.kiwiproject.consul.option.Options.optionallyAdd;
import org.immutables.value.Value;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@Value.Immutable
@Value.Style(jakarta = true)
public abstract class EventOptions implements ParamAdder {
public static final EventOptions BLANK = ImmutableEventOptions.builder().build();
public abstract Optional getDatacenter();
public abstract Optional getNodeFilter();
public abstract Optional getServiceFilter();
public abstract Optional getTagFilter();
@Override
public Map toQuery() {
Map result = new HashMap<>();
optionallyAdd(result, "node", getNodeFilter());
optionallyAdd(result, "service", getServiceFilter());
optionallyAdd(result, "tag", getTagFilter());
optionallyAdd(result, "dc", getDatacenter());
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy