@Test(expected = ParameterValueException.class) public void convertWrongDestinationsTest() throws ParameterValueException { String[] wrongDestinations = new String[]{"foo"}; MatrixRequestHandler.convertDestinations(wrongDestinations, this.coordinates); }
protected static Coordinate[] convertDestinations(String[] destinationsIndex, Coordinate[] locations) throws ParameterValueException { int length = destinationsIndex.length; if (length == 0) return locations; if (length == 1 && "all".equalsIgnoreCase(destinationsIndex[0])) return locations; try { ArrayList<Coordinate> indexCoordinateArray = convertIndexToLocations(destinationsIndex, locations); return indexCoordinateArray.toArray(new Coordinate[0]); } catch (Exception ex) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_DESTINATIONS); } }
MatrixRequestHandler { protected static Coordinate[] convertDestinations(String[] destinationsIndex, Coordinate[] locations) throws ParameterValueException { int length = destinationsIndex.length; if (length == 0) return locations; if (length == 1 && "all".equalsIgnoreCase(destinationsIndex[0])) return locations; try { ArrayList<Coordinate> indexCoordinateArray = convertIndexToLocations(destinationsIndex, locations); return indexCoordinateArray.toArray(new Coordinate[0]); } catch (Exception ex) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_DESTINATIONS); } } }
MatrixRequestHandler { protected static Coordinate[] convertDestinations(String[] destinationsIndex, Coordinate[] locations) throws ParameterValueException { int length = destinationsIndex.length; if (length == 0) return locations; if (length == 1 && "all".equalsIgnoreCase(destinationsIndex[0])) return locations; try { ArrayList<Coordinate> indexCoordinateArray = convertIndexToLocations(destinationsIndex, locations); return indexCoordinateArray.toArray(new Coordinate[0]); } catch (Exception ex) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_DESTINATIONS); } } private  MatrixRequestHandler(); }
MatrixRequestHandler { protected static Coordinate[] convertDestinations(String[] destinationsIndex, Coordinate[] locations) throws ParameterValueException { int length = destinationsIndex.length; if (length == 0) return locations; if (length == 1 && "all".equalsIgnoreCase(destinationsIndex[0])) return locations; try { ArrayList<Coordinate> indexCoordinateArray = convertIndexToLocations(destinationsIndex, locations); return indexCoordinateArray.toArray(new Coordinate[0]); } catch (Exception ex) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_DESTINATIONS); } } private  MatrixRequestHandler(); static MatrixResult generateMatrixFromRequest(MatrixRequest request); static org.heigit.ors.matrix.MatrixRequest convertMatrixRequest(MatrixRequest request); static int convertMetrics(MatrixRequestEnums.Metrics[] metrics); }
MatrixRequestHandler { protected static Coordinate[] convertDestinations(String[] destinationsIndex, Coordinate[] locations) throws ParameterValueException { int length = destinationsIndex.length; if (length == 0) return locations; if (length == 1 && "all".equalsIgnoreCase(destinationsIndex[0])) return locations; try { ArrayList<Coordinate> indexCoordinateArray = convertIndexToLocations(destinationsIndex, locations); return indexCoordinateArray.toArray(new Coordinate[0]); } catch (Exception ex) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_DESTINATIONS); } } private  MatrixRequestHandler(); static MatrixResult generateMatrixFromRequest(MatrixRequest request); static org.heigit.ors.matrix.MatrixRequest convertMatrixRequest(MatrixRequest request); static int convertMetrics(MatrixRequestEnums.Metrics[] metrics);  }