diff --git a/samples/weather/src/main/java/org/acme/Weather.java b/samples/weather/src/main/java/org/acme/Weather.java index 86e909c..e8deca5 100644 --- a/samples/weather/src/main/java/org/acme/Weather.java +++ b/samples/weather/src/main/java/org/acme/Weather.java @@ -43,7 +43,7 @@ String formatForecast(Forecast forecast) { Wind: {p.windSpeed} {p.windDirection} Forecast: {p.detailedForecast} """, - Map.of("p", period)).toString(); + Map.of("p", period)); }).collect(Collectors.joining("\n---\n")); } @@ -57,7 +57,7 @@ String formatAlerts(Alerts alerts) { Description: {p.description} Instructions: {p.instruction} """, - Map.of("p", feature.properties())).toString(); + Map.of("p", feature.properties())); }).collect(Collectors.joining("\n---\n")); } @@ -76,7 +76,7 @@ public interface WeatherClient { Forecast getForecast(@Url String url); } - static record Properties( + public record Properties( String id, String areaDesc, String event, @@ -85,14 +85,14 @@ static record Properties( String instruction) { } - static record Feature( + public record Feature( String id, String type, Object geometry, Properties properties) { } - static record Alerts( + public record Alerts( List context, String type, List features, @@ -100,7 +100,7 @@ static record Alerts( String updated) { } - static record Period( + public record Period( String name, int temperature, String temperatureUnit, @@ -109,11 +109,11 @@ static record Period( String detailedForecast) { } - static record ForecastProperties( + public record ForecastProperties( List periods) { } - static record Forecast( + public record Forecast( ForecastProperties properties) { }