use of org.neo4j.graphdb.PropertyContainer in project neo4j-mobile-android by neo4j-contrib.
the class PatternFinder method checkProperties.
private boolean checkProperties(AbstractPatternObject<? extends PropertyContainer> patternObject, PropertyContainer object) {
PropertyContainer associatedObject = patternObject.getAssociation();
if (associatedObject != null && !object.equals(associatedObject)) {
return false;
}
for (Map.Entry<String, Collection<ValueMatcher>> matchers : patternObject.getPropertyConstraints()) {
String key = matchers.getKey();
Object propertyValue = object.getProperty(key, null);
for (ValueMatcher matcher : matchers.getValue()) {
if (!matcher.matches(propertyValue)) {
return false;
}
}
}
return true;
}
Aggregations