Search in sources :

Example 1 with Triple

use of org.drools.core.util.Triple in project drools by kiegroup.

the class TripleBasedTypes method remove.

public Object remove(Object key) {
    Triple t = getProxyTripleByTraitType(key);
    if (t == null) {
        return false;
    }
    store.remove(t);
    store.remove(property(TripleStore.TYPE, key));
    return t.getValue();
}
Also used : Triple(org.drools.core.util.Triple)

Example 2 with Triple

use of org.drools.core.util.Triple in project drools by kiegroup.

the class TripleBasedTypes method equals.

public boolean equals(Object o) {
    if (this == o)
        return true;
    if (!this.getClass().equals(o.getClass()))
        return false;
    Object obj = getObject();
    Object other = ((TripleBasedStruct) o).getObject();
    if (obj == other)
        return true;
    Collection<Triple> l1 = getSchemaTriplesForSubject(obj);
    Collection<Triple> l2 = getSchemaTriplesForSubject(other);
    if (l1.size() != l2.size()) {
        return false;
    }
    for (Triple t : l1) {
        if (!l2.contains(t)) {
            return false;
        }
    }
    return true;
}
Also used : Triple(org.drools.core.util.Triple)

Example 3 with Triple

use of org.drools.core.util.Triple in project drools by kiegroup.

the class TripleBasedStruct method equals.

public boolean equals(Object o) {
    if (this == o)
        return true;
    if (!this.getClass().equals(o.getClass()))
        return false;
    Object obj = getObject();
    Object other = ((TripleBasedStruct) o).getObject();
    if (obj == other)
        return true;
    Collection<Triple> l1 = getTriplesForSubject(obj);
    Collection<Triple> l2 = getTriplesForSubject(other);
    if (l1.size() != l2.size()) {
        return false;
    }
    for (Triple t : l1) {
        if (!l2.contains(t)) {
            return false;
        }
    }
    return true;
}
Also used : Triple(org.drools.core.util.Triple)

Aggregations

Triple (org.drools.core.util.Triple)3