2 * Copyright (c) 2010-2021 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.atlona.internal.pro3;
15 import java.util.Collections;
16 import java.util.HashSet;
19 import org.openhab.binding.atlona.internal.handler.AtlonaCapabilities;
22 * The capabilities class for the Atlona PRO3 line. Each PRO3 model differs in the number of (output) ports that can be
23 * powered, the number of audio ports there are and which (output) ports are HDMI ports.
25 * @author Tim Roberts - Initial contribution
26 * @author Michael Lobstein - Add support for AT-PRO3HD66M
28 public class AtlonaPro3Capabilities extends AtlonaCapabilities {
31 * Number of power ports
33 private final int nbrPowerPorts;
36 * Number of audio ports
38 private final int nbrAudioPorts;
41 * The set of output ports that are HDMI ports
43 private final Set<Integer> hdmiPorts;
46 * Indicates if the thing is a 4K/UHD model vs an older HD model
48 private final boolean isUHDModel;
51 * Constructs the capabilities from the parms
53 * @param nbrPowerPorts a greater than 0 number of power ports
54 * @param nbrAudioPorts a greater than 0 number of audio ports
55 * @param hdmiPorts a non-null, non-empty set of hdmi ports
57 public AtlonaPro3Capabilities(int nbrPowerPorts, int nbrAudioPorts, Set<Integer> hdmiPorts, boolean isUHDModel) {
60 if (hdmiPorts == null) {
61 throw new IllegalArgumentException("hdmiPorts cannot be null");
64 if (hdmiPorts.isEmpty()) {
65 throw new IllegalArgumentException("hdmiPorts cannot be empty");
68 this.nbrPowerPorts = nbrPowerPorts;
69 this.nbrAudioPorts = nbrAudioPorts;
70 this.hdmiPorts = Collections.unmodifiableSet(new HashSet<>(hdmiPorts));
71 this.isUHDModel = isUHDModel;
75 * Returns the number of power ports
77 * @return a greater than 0 number of power ports
79 int getNbrPowerPorts() {
84 * Returns the number of audio ports
86 * @return a greater than 0 number of audio ports
88 int getNbrAudioPorts() {
93 * Returns the set of hdmi ports
95 * @return a non-null, non-empty immutable set of hdmi ports
97 Set<Integer> getHdmiPorts() {
102 * Returns a flag indicating the model type
104 * @return boolean true if the thing is a 4K/UHD model
106 boolean isUHDModel() {