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.homeconnect.internal.client.model;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
21 * @author Jonas BrĂ¼stel - Initial contribution
27 private final @Nullable String key;
28 private final @Nullable String value;
29 private final @Nullable String unit;
31 public Option(@Nullable String key, @Nullable String value, @Nullable String unit) {
37 public @Nullable String getKey() {
41 public @Nullable String getValue() {
45 public boolean getValueAsBoolean() {
46 return Boolean.parseBoolean(value);
49 public int getValueAsInt() {
51 String stringValue = value;
52 return stringValue != null ? Integer.parseInt(stringValue) : 0;
55 public @Nullable String getUnit() {
60 public String toString() {
61 return "Option [key=" + key + ", value=" + value + ", unit=" + unit + "]";