]> git.basschouten.com Git - openhab-addons.git/blob
6fc021eb077b0c587d8b5ef8f40ea3b81d8ef1ea
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20
21 /**
22  * The {@link AirQualityJsonCity} 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 AirQualityJsonCity {
29
30     private String name = "";
31     private @Nullable String url;
32     private List<Double> geo = new ArrayList<>();
33
34     public String getName() {
35         return name;
36     }
37
38     public @Nullable String getUrl() {
39         return url;
40     }
41
42     public String getGeo() {
43         List<String> list = new ArrayList<>();
44         geo.forEach(item -> list.add(item.toString()));
45         return String.join(",", list);
46     }
47 }