]> git.basschouten.com Git - openhab-addons.git/blob
d4455479a72f00c3e937a96f811303f405808f7e
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.json;
14
15 import java.util.ArrayList;
16 import java.util.List;
17 import java.util.stream.Collectors;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.eclipse.jdt.annotation.Nullable;
21
22 /**
23  * The {@link AirQualityJsonCity} is responsible for storing
24  * the "city" node from the waqi.org JSON response
25  *
26  * @author Kuba Wolanin - Initial contribution
27  */
28 @NonNullByDefault
29 public class AirQualityJsonCity {
30
31     private String name = "";
32     private @Nullable String url;
33     private List<Double> geo = new ArrayList<>();
34
35     public String getName() {
36         return name;
37     }
38
39     public @Nullable String getUrl() {
40         return url;
41     }
42
43     public String getGeo() {
44         return geo.stream().map(Object::toString).collect(Collectors.joining(", "));
45     }
46 }