
software.amazon.event.ruler.SubRuleContext Maven / Gradle / Ivy
package software.amazon.event.ruler;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
* This class stores context regarding a sub-rule.
*
* A sub-rule refers to name/value pairs, usually represented by Map of String to List of Patterns, that compose a rule.
* In the case of $or, one rule will have multiple name/value pairs, and this is why we use the "sub-rule" terminology.
*/
public class SubRuleContext {
private final double id;
private SubRuleContext(double id) {
this.id = id;
}
public double getId() {
return id;
}
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof SubRuleContext)) {
return false;
}
SubRuleContext otherContext = (SubRuleContext) o;
return id == otherContext.id;
}
@Override
public int hashCode() {
return Double.hashCode(id);
}
/**
* Generator for SubRuleContexts.
*/
static final class Generator {
private double nextId = -Double.MAX_VALUE;
private Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy