Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Polish sample #47

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions samples/weather/src/main/java/org/acme/Weather.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand All @@ -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"));
}

Expand All @@ -76,7 +76,7 @@ public interface WeatherClient {
Forecast getForecast(@Url String url);
}

static record Properties(
public record Properties(
String id,
String areaDesc,
String event,
Expand All @@ -85,22 +85,22 @@ 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<String> context,
String type,
List<Feature> features,
String title,
String updated) {
}

static record Period(
public record Period(
String name,
int temperature,
String temperatureUnit,
Expand All @@ -109,11 +109,11 @@ static record Period(
String detailedForecast) {
}

static record ForecastProperties(
public record ForecastProperties(
List<Period> periods) {
}

static record Forecast(
public record Forecast(
ForecastProperties properties) {
}

Expand Down
Loading