Example usage for com.amazonaws.services.importexport.model InvalidParameterException InvalidParameterException

List of usage examples for com.amazonaws.services.importexport.model InvalidParameterException InvalidParameterException

Introduction

In this page you can find the example usage for com.amazonaws.services.importexport.model InvalidParameterException InvalidParameterException.

Prototype

public InvalidParameterException(String message) 

Source Link

Document

Constructs a new InvalidParameterException with the specified error message.

Usage

From source file:org.transitime.core.travelTimes.TravelTimesProcessor.java

License:Open Source License

/**
 * Number of travel time segments for the stop path specified.
 * //from  ww w. j  ava  2s .  c o  m
 * @param trip
 * @param stopPathIndex
 * @return Number of travel time segments
 * @throws InvalidParameterException
 */
private static int getNumTravelTimeSegments(Trip trip, int stopPathIndex) {
    StopPath stopPath = trip.getStopPath(stopPathIndex);
    if (stopPath == null) {
        String message = "In getNumTravelTimeSegments() stopPathIndex=" + stopPathIndex + " not "
                + "valid for trip=" + trip;
        logger.error(message);
        throw new InvalidParameterException(message);
    }
    double pathLength = stopPath.getLength();
    return getNumTravelTimeSegments(pathLength);
}