/** * Constructs a condition that is equivalent to the type constraints of this query if there are any. * * @param types * @return */ private static Condition<TitanRelation> getTypeCondition(Set<RelationType> types) { assert !types.isEmpty(); if (types.size() == 1) return new RelationTypeCondition<TitanRelation>(types.iterator().next()); Or<TitanRelation> typeCond = new Or<TitanRelation>(types.size()); for (RelationType type : types) typeCond.add(new RelationTypeCondition<TitanRelation>(type)); return typeCond; }
@Override public int hashCode() { return new HashCodeBuilder().append(getType()).append(relationType).toHashCode(); }
@Override public int hashCode() { return new HashCodeBuilder().append(getType()).append(relationType).toHashCode(); }
/** * Constructs a condition that is equivalent to the type constraints of this query if there are any. * * @param types * @return */ private static Condition<TitanRelation> getTypeCondition(Set<RelationType> types) { assert !types.isEmpty(); if (types.size() == 1) return new RelationTypeCondition<TitanRelation>(types.iterator().next()); Or<TitanRelation> typeCond = new Or<TitanRelation>(types.size()); for (RelationType type : types) typeCond.add(new RelationTypeCondition<TitanRelation>(type)); return typeCond; }
@Override public int hashCode() { return new HashCodeBuilder().append(getType()).append(relationType).toHashCode(); }
/** * Constructs a condition that is equivalent to the type constraints of this query if there are any. * * @param types * @return */ private static Condition<TitanRelation> getTypeCondition(Set<RelationType> types) { assert !types.isEmpty(); if (types.size() == 1) return new RelationTypeCondition<TitanRelation>(types.iterator().next()); Or<TitanRelation> typeCond = new Or<TitanRelation>(types.size()); for (RelationType type : types) typeCond.add(new RelationTypeCondition<TitanRelation>(type)); return typeCond; }