public Multimap<String, EdgeRule> getRules(EdgeRuleQuery q) throws EdgeRuleNotFoundException {
Multimap<String, EdgeRule> found = null;
- if (q.getVersion().isPresent()) {
- found = extractRules(q.getFilter(), q.getVersion().get());
+ Optional<SchemaVersion> versionOpt = q.getVersion();
+ if (versionOpt.isPresent()) {
+ found = extractRules(q.getFilter(), versionOpt.get());
} else {
found = extractRules(q.getFilter(), schemaVersions.getDefaultVersion());
}
*/
public EdgeRule getRule(EdgeRuleQuery q) throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
Multimap<String, EdgeRule> found = null;
- if (q.getVersion().isPresent()) {
- found = extractRules(q.getFilter(), q.getVersion().get());
+ Optional<SchemaVersion> versionOpt = q.getVersion();
+ if (versionOpt.isPresent()) {
+ found = extractRules(q.getFilter(), versionOpt.get());
} else {
found = extractRules(q.getFilter(), schemaVersions.getDefaultVersion());
}
* @return boolean
*/
public boolean hasRule(EdgeRuleQuery q) {
- if (q.getVersion().isPresent()) {
- return !extractRules(q.getFilter(), q.getVersion().get()).isEmpty();
+ Optional<SchemaVersion> versionOpt = q.getVersion();
+ if (versionOpt.isPresent()) {
+ return !extractRules(q.getFilter(), versionOpt.get()).isEmpty();
} else {
return !extractRules(q.getFilter(), schemaVersions.getDefaultVersion()).isEmpty();
}
/**
* Returns if the given node type has any cousin relationships in the current version.
- *
+ *
* @param nodeType
* @return boolean
*/
/**
* Returns if the given node type has any cousin relationships in the given version.
- *
+ *
* @param nodeType
* @return boolean
*/
/**
* Returns if the given node type has any child relationships (ie it contains another node type) in the current
* version.
- *
+ *
* @param nodeType
* @return boolean
*/
/**
* Returns if the given node type has any child relationships (ie it contains another node type) in the given
* version.
- *
+ *
* @param nodeType
* @return boolean
*/
/**
* Returns if the given node type has any parent relationships (ie it is contained by another node type) in the
* current version.
- *
+ *
* @param nodeType
* @return boolean
*/
/**
* Returns if the given node type has any parent relationships (ie it is contained by another node type) in the
* given version.
- *
+ *
* @param nodeType
* @return boolean
*/