public void addContext(String name, String value) { if (null == name || null == value) { throw new IllegalArgumentException("Propety must have non-null name and value"); } getContext().put(name, value); }
public EventConditionEval(EventCondition condition, Event value) { super(Type.EVENT, condition.match(value), value.getCtime(), value.getContext()); this.condition = condition; this.value = value; }
public ExternalConditionEval(ExternalCondition condition, Event event) { super(Type.EXTERNAL, condition.match(event.getText()), event.getCtime(), event.getContext()); this.condition = condition; this.event = event; }
if (o1.getContext() == null && o2.getContext() == null) { return 0; if (o1.getContext().isEmpty() && o2.getContext().isEmpty()) { return 0; if (!o1.getContext().containsKey(contextKey) && !o2.getContext().containsKey(contextKey)) { return 0; if (!o1.getContext().containsKey(contextKey) && o2.getContext().containsKey(contextKey)) { return 1; if (!o1.getContext().containsKey(contextKey) && !o2.getContext().containsKey(contextKey)) { return -1; return o1.getContext().get(contextKey).compareTo(o2.getContext().get(contextKey)) * iOrder;
public Event(Event event) { if (event == null) { throw new IllegalArgumentException("event must be not null"); } this.tenantId = event.getTenantId(); this.trigger = event.getTrigger(); this.dampening = event.getDampening() != null ? new Dampening(event.getDampening()) : null; // evalSets are maintained as reference as it is a mostly read-only field this.evalSets = event.getEvalSets(); this.eventType = event.getEventType(); this.ctime = event.getCtime(); this.id = event.getId(); this.dataSource = event.getDataSource(); this.dataId = event.getDataId(); this.context = new HashMap<>(event.getContext()); this.category = event.getCategory(); this.text = event.getText(); this.tags = new HashMap<>(event.getTags()); }