@Test void preconditionsShouldBeAsserted() { assertThatIllegalArgumentException() .isThrownBy(() -> Relationship.create(null, null, Node.create("a"), new String[0])) .withMessage("Left node is required."); assertThatIllegalArgumentException() .isThrownBy(() -> Relationship.create(Node.create("a"), null, null, new String[0])) .withMessage("Right node is required."); }
static Relationship create(Node left, Direction direction, Node right, String... types) { Assertions.notNull(left, "Left node is required."); Assertions.notNull(right, "Right node is required."); List<String> listOfTypes = Arrays.stream(types) .filter(type -> !(type == null || type.isEmpty())) .collect(Collectors.toList()); Details details = Details.create( Optional.ofNullable(direction).orElse(Direction.UNI), null, listOfTypes.isEmpty() ? null : new RelationshipTypes(listOfTypes)); return new Relationship(left, details, right); }
Relationship implements RelationshipPattern, PropertyContainer, ExposesProperties<Relationship> { static Relationship create(Node left, Direction direction, Node right, String... types) { Assertions.notNull(left, "Left node is required."); Assertions.notNull(right, "Right node is required."); List<String> listOfTypes = Arrays.stream(types) .filter(type -> !(type == null || type.isEmpty())) .collect(Collectors.toList()); Details details = Details.create( Optional.ofNullable(direction).orElse(Direction.UNI), null, listOfTypes.isEmpty() ? null : new RelationshipTypes(listOfTypes)); return new Relationship(left, details, right); } }
Relationship implements RelationshipPattern, PropertyContainer, ExposesProperties<Relationship> { static Relationship create(Node left, Direction direction, Node right, String... types) { Assertions.notNull(left, "Left node is required."); Assertions.notNull(right, "Right node is required."); List<String> listOfTypes = Arrays.stream(types) .filter(type -> !(type == null || type.isEmpty())) .collect(Collectors.toList()); Details details = Details.create( Optional.ofNullable(direction).orElse(Direction.UNI), null, listOfTypes.isEmpty() ? null : new RelationshipTypes(listOfTypes)); return new Relationship(left, details, right); } Relationship(Node left, Details details, Node right); }
Relationship implements RelationshipPattern, PropertyContainer, ExposesProperties<Relationship> { static Relationship create(Node left, Direction direction, Node right, String... types) { Assertions.notNull(left, "Left node is required."); Assertions.notNull(right, "Right node is required."); List<String> listOfTypes = Arrays.stream(types) .filter(type -> !(type == null || type.isEmpty())) .collect(Collectors.toList()); Details details = Details.create( Optional.ofNullable(direction).orElse(Direction.UNI), null, listOfTypes.isEmpty() ? null : new RelationshipTypes(listOfTypes)); return new Relationship(left, details, right); } Relationship(Node left, Details details, Node right); Details getDetails(); Relationship named(String newSymbolicName); Relationship named(SymbolicName newSymbolicName); Relationship unbounded(); Relationship min(Integer minimum); Relationship max(Integer maximum); Relationship length(Integer minimum, Integer maximum); @Override Relationship withProperties(MapExpression newProperties); @Override Relationship withProperties(Object... keysAndValues); @Override Property property(String name); @Override Optional<SymbolicName> getSymbolicName(); @Override SymbolicName getRequiredSymbolicName(); @Override RelationshipChain relationshipTo(Node other, String... types); @Override RelationshipChain relationshipFrom(Node other, String... types); @Override RelationshipChain relationshipBetween(Node other, String... types); @Override void accept(Visitor visitor); MapProjection project(Object... entries); }
Relationship implements RelationshipPattern, PropertyContainer, ExposesProperties<Relationship> { static Relationship create(Node left, Direction direction, Node right, String... types) { Assertions.notNull(left, "Left node is required."); Assertions.notNull(right, "Right node is required."); List<String> listOfTypes = Arrays.stream(types) .filter(type -> !(type == null || type.isEmpty())) .collect(Collectors.toList()); Details details = Details.create( Optional.ofNullable(direction).orElse(Direction.UNI), null, listOfTypes.isEmpty() ? null : new RelationshipTypes(listOfTypes)); return new Relationship(left, details, right); } Relationship(Node left, Details details, Node right); Details getDetails(); Relationship named(String newSymbolicName); Relationship named(SymbolicName newSymbolicName); Relationship unbounded(); Relationship min(Integer minimum); Relationship max(Integer maximum); Relationship length(Integer minimum, Integer maximum); @Override Relationship withProperties(MapExpression newProperties); @Override Relationship withProperties(Object... keysAndValues); @Override Property property(String name); @Override Optional<SymbolicName> getSymbolicName(); @Override SymbolicName getRequiredSymbolicName(); @Override RelationshipChain relationshipTo(Node other, String... types); @Override RelationshipChain relationshipFrom(Node other, String... types); @Override RelationshipChain relationshipBetween(Node other, String... types); @Override void accept(Visitor visitor); MapProjection project(Object... entries);  }