]> git.basschouten.com Git - openhab-addons.git/blob
00d933b3839e578eba2c3dc1b34822e2c60c9af9
[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.openuv.internal;
14
15 /**
16  * The {@link ReportConfiguration} is the class used to match the
17  * thing configuration.
18  *
19  * @author GaĆ«l L"hopital - Initial contribution
20  */
21 public class ReportConfiguration {
22     String[] elements = null;
23
24     private String location;
25     public Integer refresh;
26
27     public String getLatitude() {
28         return getElement(0);
29     }
30
31     public String getLongitude() {
32         return getElement(1);
33     }
34
35     public String getAltitude() {
36         return getElement(2);
37     }
38
39     private String getElement(int index) {
40         if (elements == null) {
41             elements = location.split(",");
42         }
43         if (index < elements.length) {
44             return elements[index].trim();
45         } else {
46             return null;
47         }
48     }
49 }