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.revogi.internal.api;
15 import java.util.List;
16 import java.util.Objects;
18 import com.google.gson.annotations.SerializedName;
21 * {@link StatusDTO} is the internal data model used to control Revogi's SmartStrip
23 * @author Andi Bräu - Initial contribution
26 public class StatusDTO {
27 private final boolean online;
28 private final int responseCode;
29 @SerializedName("switch")
30 private final List<Integer> switchValue;
31 private final List<Integer> watt;
32 private final List<Integer> amp;
42 public StatusDTO(boolean online, int responseCode, List<Integer> switchValue, List<Integer> watt,
45 this.responseCode = responseCode;
46 this.switchValue = switchValue;
51 public boolean isOnline() {
55 public int getResponseCode() {
59 public List<Integer> getSwitchValue() {
63 public List<Integer> getWatt() {
67 public List<Integer> getAmp() {
72 public boolean equals(final Object o) {
76 if (o == null || getClass() != o.getClass()) {
79 StatusDTO status = (StatusDTO) o;
80 return online == status.online && responseCode == status.responseCode
81 && Objects.equals(switchValue, status.switchValue) && Objects.equals(watt, status.watt)
82 && Objects.equals(amp, status.amp);
86 public int hashCode() {
87 return Objects.hash(online, responseCode, switchValue, watt, amp);