]> git.basschouten.com Git - openhab-addons.git/blob
b06263d21254b4a526d7301004ba165a734f011a
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.atlona.internal.pro3;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  *
19  * @author Tim Roberts - Initial contribution
20  */
21 @NonNullByDefault
22 public class AtlonaPro3Utilities {
23     /**
24      * Helper method to create a channel id from a group with no port number attached
25      *
26      * @param group a group name
27      * @param channelId the channel id
28      * @return group + "#" + channelId
29      */
30     public static String createChannelID(String group, String channelId) {
31         return group + "#" + channelId;
32     }
33
34     /**
35      * Helper method to create a channel id from a group, port number and channel id
36      *
37      * @param group the group name
38      * @param portNbr the port number
39      * @param channelId the channel id
40      * @return group + portNbr + "#" + channelId
41      */
42     public static String createChannelID(String group, int portNbr, String channelId) {
43         return group + portNbr + "#" + channelId;
44     }
45 }