@Test public void testUnconstrained() { PathConstraints pathConstraints = PathConstraintsUtil.createPathConstraints(PathConstraintsInput.unconstrained()); assertEquals(LocationSpecifier.ALL_LOCATIONS, pathConstraints.getStartLocation()); assertEquals(NoNodesNodeSpecifier.INSTANCE, pathConstraints.getForbiddenLocations()); assertEquals(NoNodesNodeSpecifier.INSTANCE, pathConstraints.getTransitLocations()); assertEquals(AllNodesNodeSpecifier.INSTANCE, pathConstraints.getEndLocation()); }
public static PathConstraints createPathConstraints(PathConstraintsInput input) { NodeSpecifier forbiddenTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getForbiddenLocations(), NoNodesNodeSpecifier.INSTANCE); NodeSpecifier requiredTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getTransitLocations(), NoNodesNodeSpecifier.INSTANCE); return PathConstraints.builder() .withStartLocation( SpecifierFactories.getLocationSpecifierOrDefault( input.getStartLocation(), LocationSpecifier.ALL_LOCATIONS)) .withEndLocation( SpecifierFactories.getNodeSpecifierOrDefault( input.getEndLocation(), AllNodesNodeSpecifier.INSTANCE)) .avoid(forbiddenTransitNodes) .through(requiredTransitNodes) .build(); }
PathConstraintsUtil { public static PathConstraints createPathConstraints(PathConstraintsInput input) { NodeSpecifier forbiddenTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getForbiddenLocations(), NoNodesNodeSpecifier.INSTANCE); NodeSpecifier requiredTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getTransitLocations(), NoNodesNodeSpecifier.INSTANCE); return PathConstraints.builder() .withStartLocation( SpecifierFactories.getLocationSpecifierOrDefault( input.getStartLocation(), LocationSpecifier.ALL_LOCATIONS)) .withEndLocation( SpecifierFactories.getNodeSpecifierOrDefault( input.getEndLocation(), AllNodesNodeSpecifier.INSTANCE)) .avoid(forbiddenTransitNodes) .through(requiredTransitNodes) .build(); } }
PathConstraintsUtil { public static PathConstraints createPathConstraints(PathConstraintsInput input) { NodeSpecifier forbiddenTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getForbiddenLocations(), NoNodesNodeSpecifier.INSTANCE); NodeSpecifier requiredTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getTransitLocations(), NoNodesNodeSpecifier.INSTANCE); return PathConstraints.builder() .withStartLocation( SpecifierFactories.getLocationSpecifierOrDefault( input.getStartLocation(), LocationSpecifier.ALL_LOCATIONS)) .withEndLocation( SpecifierFactories.getNodeSpecifierOrDefault( input.getEndLocation(), AllNodesNodeSpecifier.INSTANCE)) .avoid(forbiddenTransitNodes) .through(requiredTransitNodes) .build(); } private  PathConstraintsUtil(); }
PathConstraintsUtil { public static PathConstraints createPathConstraints(PathConstraintsInput input) { NodeSpecifier forbiddenTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getForbiddenLocations(), NoNodesNodeSpecifier.INSTANCE); NodeSpecifier requiredTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getTransitLocations(), NoNodesNodeSpecifier.INSTANCE); return PathConstraints.builder() .withStartLocation( SpecifierFactories.getLocationSpecifierOrDefault( input.getStartLocation(), LocationSpecifier.ALL_LOCATIONS)) .withEndLocation( SpecifierFactories.getNodeSpecifierOrDefault( input.getEndLocation(), AllNodesNodeSpecifier.INSTANCE)) .avoid(forbiddenTransitNodes) .through(requiredTransitNodes) .build(); } private  PathConstraintsUtil(); static PathConstraints createPathConstraints(PathConstraintsInput input); }
PathConstraintsUtil { public static PathConstraints createPathConstraints(PathConstraintsInput input) { NodeSpecifier forbiddenTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getForbiddenLocations(), NoNodesNodeSpecifier.INSTANCE); NodeSpecifier requiredTransitNodes = SpecifierFactories.getNodeSpecifierOrDefault( input.getTransitLocations(), NoNodesNodeSpecifier.INSTANCE); return PathConstraints.builder() .withStartLocation( SpecifierFactories.getLocationSpecifierOrDefault( input.getStartLocation(), LocationSpecifier.ALL_LOCATIONS)) .withEndLocation( SpecifierFactories.getNodeSpecifierOrDefault( input.getEndLocation(), AllNodesNodeSpecifier.INSTANCE)) .avoid(forbiddenTransitNodes) .through(requiredTransitNodes) .build(); } private  PathConstraintsUtil(); static PathConstraints createPathConstraints(PathConstraintsInput input);  }