class 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();

}