2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.dwdunwetter.internal.dto;
15 import java.math.BigDecimal;
16 import java.time.Instant;
19 * Data for one warning.
21 * @author Martin Koehler - Initial contribution
23 public class DwdWarningData {
27 private Severity severity;
28 private String description;
29 private Instant effective;
30 private Instant expires;
31 private Instant onset;
33 private String status;
34 private String msgType;
35 private String headline;
36 private BigDecimal altitude;
37 private BigDecimal ceiling;
38 private String instruction;
39 private Urgency urgency;
41 public void setId(String id) {
45 public String getId() {
49 public void setSeverity(Severity severity) {
50 this.severity = severity;
53 public Severity getSeverity() {
54 return severity == null ? Severity.UNKNOWN : severity;
57 public void setDescription(String description) {
58 this.description = description;
61 public String getDescription() {
65 public void setEffective(Instant effective) {
66 this.effective = effective;
69 public Instant getEffective() {
73 public void setExpires(Instant expires) {
74 this.expires = expires;
77 public Instant getExpires() {
81 public void setEvent(String event) {
85 public String getEvent() {
89 public void setStatus(String status) {
93 public boolean isTest() {
94 return "Test".equalsIgnoreCase(status);
97 public void setMsgType(String msgType) {
98 this.msgType = msgType;
101 public boolean isCancel() {
102 return "Cancel".equalsIgnoreCase(msgType);
105 public void setHeadline(String headline) {
106 this.headline = headline;
109 public String getHeadline() {
113 public Instant getOnset() {
117 public void setOnset(Instant onset) {
121 public void setAltitude(BigDecimal altitude) {
122 this.altitude = altitude;
125 public BigDecimal getAltitude() {
129 public void setCeiling(BigDecimal ceiling) {
130 this.ceiling = ceiling;
133 public BigDecimal getCeiling() {
137 public void setInstruction(String instruction) {
138 this.instruction = instruction;
141 public String getInstruction() {
145 public void setUrgency(Urgency urgency) {
146 this.urgency = urgency;
149 public Urgency getUrgency() {
154 public int hashCode() {
155 final int prime = 31;
157 result = prime * result + ((id == null) ? 0 : id.hashCode());
162 public boolean equals(Object obj) {
169 if (getClass() != obj.getClass()) {
172 DwdWarningData other = (DwdWarningData) obj;
174 if (other.id != null) {
177 } else if (!id.equals(other.id)) {