]> git.basschouten.com Git - openhab-addons.git/blob
ad0cb40bc6437c5f0a7db9c13a549ce308f29512
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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 @Nullable Double get3h() {
35         return threeHours;
36     }
37
38     public Double getVolume() {
39         return oneHour != null ? oneHour : threeHours != null ? threeHours / 3 : 0;
40     }
41 }