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.binding.max.internal.message;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.slf4j.Logger;
19 * The {@link: FMessage} contains information about the Cube NTP Configuration
20 * This is the response to a f: command
22 * @author Marcel Verpaalen - Initial contribution
25 public final class FMessage extends Message {
27 private String ntpServer1 = "";
28 private String ntpServer2 = "";
31 * The {@link: FMessage} contains information about the Cube NTP Configuration
33 * @param raw String with raw message
35 public FMessage(String raw) {
38 final String[] servers = this.getPayload().split(",");
39 if (servers.length > 0) {
40 ntpServer1 = servers[0];
42 if (servers.length > 1) {
43 ntpServer2 = servers[1];
48 * @return the NTP Server1 name
50 public String getNtpServer1() {
55 * @return the NTP Server2 name
57 public String getNtpServer2() {
62 public void debug(Logger logger) {
63 logger.debug("=== F Message === ");
64 logger.trace("\tRAW : {}", this.getPayload());
65 logger.debug("\tNTP Server1 : {}", this.ntpServer1);
66 logger.debug("\tNTP Server2 : {}", this.ntpServer2);
70 public MessageType getType() {