com.barchart.ondemand.api.responses.Weather Maven / Gradle / Ivy
package com.barchart.ondemand.api.responses;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Weather extends ResponseBase {
@JsonProperty("results")
private final List results = new ArrayList();
public Collection all() {
return Collections.unmodifiableCollection(results);
}
public WeatherForecast current() {
if (isEmpty()) {
return null;
}
return results.get(0);
}
}