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.velux.internal.things;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.velux.internal.VeluxBindingConstants;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
21 * <B>Velux</B> product representation.
23 * Combined set of information describing a single Velux product.
25 * @author Guenther Schreiner - initial contribution.
28 public class VeluxGwLAN {
29 private final Logger logger = LoggerFactory.getLogger(VeluxGwLAN.class);
33 private String ipAddress = VeluxBindingConstants.UNKNOWN;
34 private String subnetMask = VeluxBindingConstants.UNKNOWN;
35 private String defaultGW = VeluxBindingConstants.UNKNOWN;
36 private boolean enabledDHCP = false;
40 public VeluxGwLAN(String ipAddress, String subnetMask, String defaultGW, boolean enabledDHCP) {
41 logger.trace("VeluxGwLAN() created.");
43 this.ipAddress = ipAddress;
44 this.subnetMask = subnetMask;
45 this.defaultGW = defaultGW;
46 this.enabledDHCP = enabledDHCP;
49 // Class access methods
51 public String getIpAddress() {
52 logger.trace("getIpAddress() returns {}.", this.ipAddress);
53 return this.ipAddress;
56 public String getSubnetMask() {
57 logger.trace("getSubnetMask() returns {}.", this.subnetMask);
58 return this.subnetMask;
61 public String getDefaultGW() {
62 logger.trace("getDefaultGW() returns {}.", this.defaultGW);
63 return this.defaultGW;
66 public boolean getDHCP() {
67 logger.trace("getDHCP() returns {}.", this.enabledDHCP ? "enabled" : "disabled");
68 return this.enabledDHCP;
72 public String toString() {
73 return String.format("ip %s, nm %s, gw %s, DHCP %s", this.ipAddress, this.subnetMask, this.defaultGW,
74 this.enabledDHCP ? "enabled" : "disabled");