2 * Copyright (c) 2010-2020 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.homematic.internal.model;
15 import org.apache.commons.lang.builder.ToStringBuilder;
16 import org.apache.commons.lang.builder.ToStringStyle;
19 * Info object which holds gateway specific informations.
21 * @author Gerhard Riegler - Initial contribution
23 public class HmGatewayInfo {
24 public static final String ID_HOMEGEAR = "HOMEGEAR";
25 public static final String ID_CCU = "CCU";
26 public static final String ID_DEFAULT = "DEFAULT";
30 private String firmware;
31 private String address;
32 private boolean rfInterface;
33 private boolean wiredInterface;
34 private boolean cuxdInterface;
35 private boolean hmipInterface;
36 private boolean groupInterface;
39 * Returns the id of the gateway type.
41 public String getId() {
46 * Sets the id of the gateway type.
48 public void setId(String id) {
53 * Returns the type of the gateway.
55 public String getType() {
60 * Sets the type of the server.
62 public void setType(String type) {
67 * Returns the firmware version of the gateway.
69 public String getFirmware() {
74 * Sets the firmware version of the gateway.
76 public void setFirmware(String firmware) {
77 this.firmware = firmware;
81 * Returns the address of the Homematic gateway.
83 public String getAddress() {
88 * Sets the address of the Homematic gateway.
90 public void setAddress(String address) {
91 this.address = address;
95 * Returns true, if the gateway is a Homegear gateway.
97 public boolean isHomegear() {
98 return ID_HOMEGEAR.equals(id);
102 * Returns true, if the gateway is a CCU.
104 public boolean isCCU() {
105 return ID_CCU.equals(id);
109 * Return true, if the gateway is a CCU1.
111 public boolean isCCU1() {
112 return "CCU".equals(type);
116 * Returns true, if the gateway supports the CUxD interface.
118 public boolean isCuxdInterface() {
119 return cuxdInterface;
123 * Sets the CUxD support of the gateway.
125 public void setCuxdInterface(boolean cuxdInterface) {
126 this.cuxdInterface = cuxdInterface;
130 * Returns true, if the gateway supports the wired interface.
132 public boolean isWiredInterface() {
133 return wiredInterface;
137 * Sets the wired support of the gateway.
139 public void setWiredInterface(boolean wiredInterface) {
140 this.wiredInterface = wiredInterface;
144 * Returns true, if the gateway supports the HMIP interface.
146 public boolean isHmipInterface() {
147 return hmipInterface;
151 * Sets the HMIP support of the gateway.
153 public void setHmipInterface(boolean hmipInterface) {
154 this.hmipInterface = hmipInterface;
158 * Returns true, if the gateway supports the Group interface.
160 public boolean isGroupInterface() {
161 return groupInterface;
165 * Sets the Group support of the gateway.
167 public void setGroupInterface(boolean groupInterface) {
168 this.groupInterface = groupInterface;
172 * Returns true, if the gateway supports the RF interface.
174 public boolean isRfInterface() {
179 * Sets the RF support of the gateway.
181 public void setRfInterface(boolean rfInterface) {
182 this.rfInterface = rfInterface;
186 public String toString() {
187 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", id).append("type", type)
188 .append("firmware", firmware).append("address", address).append("rf", rfInterface)
189 .append("wired", wiredInterface).append("hmip", hmipInterface).append("cuxd", cuxdInterface)
190 .append("group", groupInterface).toString();