]> git.basschouten.com Git - openhab-addons.git/blob
96070c1955f0764f8fc1b1dff4629ba22173a417
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.airquality.internal.api.dto;
14
15 import java.util.List;
16 import java.util.stream.Collectors;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20
21 /**
22  * The {@link AirQualityCity} is responsible for storing
23  * the "city" node from the waqi.org JSON response
24  *
25  * @author Kuba Wolanin - Initial contribution
26  */
27 @NonNullByDefault
28 public class AirQualityCity {
29     private String name = "";
30     private @Nullable String url;
31     private List<Double> geo = List.of();
32
33     public String getName() {
34         return name;
35     }
36
37     public @Nullable String getUrl() {
38         return url;
39     }
40
41     public String getGeo() {
42         return geo.stream().map(Object::toString).collect(Collectors.joining(", "));
43     }
44 }