]> git.basschouten.com Git - openhab-addons.git/blob
a8b13b9cba8fa9b29019f2e7681f4448a6cfd5c7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.openweathermap.internal.dto.base;
14
15 import org.eclipse.jdt.annotation.Nullable;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * Generated Plain Old Java Objects class for {@link Precipitation} from JSON.
21  *
22  * @author Christoph Weitkamp - Initial contribution
23  */
24 public class Precipitation {
25     @SerializedName("1h")
26     private @Nullable Double oneHour;
27     @SerializedName("3h")
28     private @Nullable Double threeHours;
29
30     public @Nullable Double get1h() {
31         return oneHour;
32     }
33
34     public void set1h(Double oneHour) {
35         this.oneHour = oneHour;
36     }
37
38     public @Nullable Double get3h() {
39         return threeHours;
40     }
41
42     public void set3h(Double threeHours) {
43         this.threeHours = threeHours;
44     }
45
46     public Double getVolume() {
47         return oneHour != null ? oneHour : threeHours != null ? threeHours / 3 : 0;
48     }
49 }