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.knx.internal.channel;
15 import static java.util.stream.Collectors.toList;
17 import java.util.Collections;
18 import java.util.List;
20 import org.eclipse.jdt.annotation.Nullable;
21 import org.openhab.binding.knx.internal.client.InboundSpec;
23 import tuwien.auto.calimero.GroupAddress;
28 * @author Simon Kaufmann - initial contribution and API.
31 public class ListenSpecImpl extends AbstractSpec implements InboundSpec {
33 private final List<GroupAddress> listenAddresses;
35 public ListenSpecImpl(@Nullable ChannelConfiguration channelConfiguration, String defaultDPT) {
36 super(channelConfiguration, defaultDPT);
37 if (channelConfiguration != null) {
38 this.listenAddresses = channelConfiguration.getListenGAs().stream().map(this::toGroupAddress)
41 this.listenAddresses = Collections.emptyList();
45 public List<GroupAddress> getGroupAddresses() {
46 return listenAddresses;