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.loxone.internal.types;
15 import java.util.HashSet;
18 import org.openhab.binding.loxone.internal.controls.LxControl;
21 * Container on Loxone Miniserver that groups {@link LxControl} objects.
23 * Examples of containers are rooms and categories.
25 * @author Pawel Pieczul - initial contribution
28 public class LxContainer {
29 private LxUuid uuid; // set by JSON deserialization
30 private String name; // set by JSON deserialization
31 private final Set<LxControl> controls;
34 * Create a new container with given uuid and name
37 controls = new HashSet<>();
41 * Obtain container's current name
44 * container's current name
46 public String getName() {
51 * Obtain container's UUID (assigned by Loxone Miniserver)
56 public LxUuid getUuid() {
61 * Add a new control to this container
63 * @param control control to be added
65 public void addControl(LxControl control) {
66 controls.add(control);
70 * Removes a control from the container
72 * @param control control object to remove from the container
73 * @return true if control object existed in the container and was removed
75 public boolean removeControl(LxControl control) {
76 return controls.remove(control);