Q:

How to optimize a lot of switch cases? 

How could I optimize having a lot of switch cases?  Is there some other method to do what I'm attempting to do? 
I have a time slider and this slider updates a variable currentTime with the value (1-24) where the current slider is and calls the updateTime() method.  In this method I have switch cases for 1 - 24 (only 3 in this example).  Instead of making 24 switch cases, could I do this in a much simpler way? 
private void updateTime() {
    switch (currentTime) {
        case 1:
            hourlyData = weatherAPI.HourlyReport(1);
            setHourlyData();
            break;
        case 2:
            hourlyData = weatherAPI.HourlyReport(2);
            setHourlyData();
            break;
        ...
        case 24:
            hourlyData = weatherAPI.HourlyReport(24);
            setHourlyData();
            break;
        default:
            System.out.println("Oops");
            break;
    }
}

--
public Map HourlyReport(int hour) {
    Hourly hourly = new Hourly(fio);
    //In case there is no hourly data available
    if (hourly.hours() < 0) {
        System.out.println("No hourly data."); 
    } else {
        hourlyData.put("Temp", hourly.getHour(hour).temperature()); // Temperature
        hourlyData.put("TempFeel", hourly.getHour(hour).apparentTemperature()); // Feel Temperature
        hourlyData.put("Humidity", hourly.getHour(hour).humidity()); // Humidity
        hourlyData.put("WindSpeed", hourly.getHour(hour).windSpeed()); // Wind Speed
        hourlyData.put("Precip", hourly.getHour(hour).precipProbability()); // Precipitation
        hourlyData.put("TimeStamp", hourly.getHour(hour).time());// TimeStamp
    }
    return hourlyData;
}

A:

The use of a switch is not justified in this case.  Use a simple if
if (currentTime > 0 && currentTime < 25) {
    hourlyData = weatherAPI.HourlyReport(currentTime);
    setHourlyData();
} else {
    System.out.println("Oops");
}

