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.atlona.internal.pro3;
15 import java.util.Collections;
16 import java.util.HashSet;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.atlona.internal.handler.AtlonaCapabilities;
23 * The capabilities class for the Atlona PRO3 line. Each PRO3 model differs in the number of (output) ports that can be
24 * powered, the number of audio ports there are and which (output) ports are HDMI ports.
26 * @author Tim Roberts - Initial contribution
27 * @author Michael Lobstein - Add support for AT-PRO3HD66M
30 public class AtlonaPro3Capabilities extends AtlonaCapabilities {
33 * Number of power ports
35 private final int nbrPowerPorts;
38 * Number of audio ports
40 private final int nbrAudioPorts;
43 * The set of output ports that are HDMI ports
45 private final Set<Integer> hdmiPorts;
48 * Indicates if the thing is a 4K/UHD model vs an older HD model
50 private final boolean isUHDModel;
53 * Constructs the capabilities from the parms
55 * @param nbrPowerPorts a greater than 0 number of power ports
56 * @param nbrAudioPorts a greater than 0 number of audio ports
57 * @param hdmiPorts a non-null, non-empty set of hdmi ports
59 public AtlonaPro3Capabilities(int nbrPowerPorts, int nbrAudioPorts, Set<Integer> hdmiPorts, boolean isUHDModel) {
62 if (hdmiPorts.isEmpty()) {
63 throw new IllegalArgumentException("hdmiPorts cannot be empty");
66 this.nbrPowerPorts = nbrPowerPorts;
67 this.nbrAudioPorts = nbrAudioPorts;
68 this.hdmiPorts = Collections.unmodifiableSet(new HashSet<>(hdmiPorts));
69 this.isUHDModel = isUHDModel;
73 * Returns the number of power ports
75 * @return a greater than 0 number of power ports
77 int getNbrPowerPorts() {
82 * Returns the number of audio ports
84 * @return a greater than 0 number of audio ports
86 int getNbrAudioPorts() {
91 * Returns the set of hdmi ports
93 * @return a non-null, non-empty immutable set of hdmi ports
95 Set<Integer> getHdmiPorts() {
100 * Returns a flag indicating the model type
102 * @return boolean true if the thing is a 4K/UHD model
104 boolean isUHDModel() {