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.io.imperihome.internal.model.param;
16 * Basic device key/value parameter.
18 * @author Pepijn de Geus - Initial contribution
20 public class DeviceParam {
22 private ParamType key;
25 public DeviceParam(ParamType type) {
29 public DeviceParam(ParamType type, Object value) {
34 public ParamType getKey() {
38 public Object getValue() {
42 public void setValue(Object value) {
47 public boolean equals(Object o) {
51 if (!(o instanceof DeviceParam)) {
55 DeviceParam that = (DeviceParam) o;
57 if (key != that.key) {
60 return value != null ? value.equals(that.value) : that.value == null;
64 public int hashCode() {
65 return key.hashCode();
69 public String toString() {
70 return "DeviceParam{" + "key=" + key + ", value='" + value + '\'' + '}';