2 * Copyright (c) 2010-2022 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.mielecloud.internal.webservice.api.json;
15 import java.util.Objects;
16 import java.util.Optional;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
21 import com.google.gson.annotations.SerializedName;
24 * Immutable POJO representing a plate power state. Queried from the Miele REST API.
26 * @author Benjamin Bolte - Initial contribution
29 public class PlateStep {
30 @SerializedName("value_raw")
32 private Integer valueRaw;
33 @SerializedName("value_localized")
35 private String valueLocalized;
36 @SerializedName("key_localized")
38 private String keyLocalized;
40 public Optional<Integer> getValueRaw() {
41 return Optional.ofNullable(valueRaw);
44 public Optional<String> getValueLocalized() {
45 return Optional.ofNullable(valueLocalized);
48 public Optional<String> getKeyLocalized() {
49 return Optional.ofNullable(keyLocalized);
53 public int hashCode() {
54 return Objects.hash(keyLocalized, valueLocalized, valueRaw);
58 public boolean equals(@Nullable Object obj) {
65 if (getClass() != obj.getClass()) {
68 PlateStep other = (PlateStep) obj;
69 return Objects.equals(keyLocalized, other.keyLocalized) && Objects.equals(valueLocalized, other.valueLocalized)
70 && Objects.equals(valueRaw, other.valueRaw);
74 public String toString() {
75 return "PlateStep [valueRaw=" + valueRaw + ", valueLocalized=" + valueLocalized + ", key_localized="