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.sonos.internal;
15 import java.util.ArrayList;
16 import java.util.Collection;
17 import java.util.List;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
22 * The {@link SonosZoneGroup} is data structure to describe
23 * Groups of Zone Players in the Sonos ecosystem
25 * @author Karel Goderis - Initial contribution
28 public class SonosZoneGroup {
30 private final List<String> members;
31 private List<String> memberZoneNames;
32 private final String coordinator;
33 private final String id;
35 public SonosZoneGroup(String id, String coordinator, Collection<String> members,
36 Collection<String> memberZoneNames) {
37 this.members = new ArrayList<>(members);
38 if (!this.members.contains(coordinator)) {
39 this.members.add(coordinator);
41 this.memberZoneNames = new ArrayList<>(memberZoneNames);
42 this.coordinator = coordinator;
46 public List<String> getMembers() {
50 public List<String> getMemberZoneNames() {
51 return memberZoneNames;
54 public String getCoordinator() {
58 public String getId() {