@Test(expected = ParameterValueException.class) public void convertToWrongMatrixProfileTypeTest() throws ParameterValueException { MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.forValue("foo")); }
protected static int convertToMatrixProfileType(APIEnums.Profile profile) throws ParameterValueException { try { int profileFromString = RoutingProfileType.getFromString(profile.toString()); if (profileFromString == 0) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } return profileFromString; } catch (Exception e) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } }
MatrixRequestHandler { protected static int convertToMatrixProfileType(APIEnums.Profile profile) throws ParameterValueException { try { int profileFromString = RoutingProfileType.getFromString(profile.toString()); if (profileFromString == 0) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } return profileFromString; } catch (Exception e) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } } }
MatrixRequestHandler { protected static int convertToMatrixProfileType(APIEnums.Profile profile) throws ParameterValueException { try { int profileFromString = RoutingProfileType.getFromString(profile.toString()); if (profileFromString == 0) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } return profileFromString; } catch (Exception e) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } } private  MatrixRequestHandler(); }
MatrixRequestHandler { protected static int convertToMatrixProfileType(APIEnums.Profile profile) throws ParameterValueException { try { int profileFromString = RoutingProfileType.getFromString(profile.toString()); if (profileFromString == 0) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } return profileFromString; } catch (Exception e) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } } 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 int convertToMatrixProfileType(APIEnums.Profile profile) throws ParameterValueException { try { int profileFromString = RoutingProfileType.getFromString(profile.toString()); if (profileFromString == 0) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } return profileFromString; } catch (Exception e) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } } private  MatrixRequestHandler(); static MatrixResult generateMatrixFromRequest(MatrixRequest request); static org.heigit.ors.matrix.MatrixRequest convertMatrixRequest(MatrixRequest request); static int convertMetrics(MatrixRequestEnums.Metrics[] metrics);  }