]> git.basschouten.com Git - openhab-addons.git/blob
6e3173b79066ae85b7dd080a682a5383e68a3cbe
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.knx.internal.channel;
14
15 import java.util.Objects;
16 import java.util.Set;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.binding.knx.internal.client.InboundSpec;
20
21 import tuwien.auto.calimero.GroupAddress;
22
23 /**
24  * Read meta-data.
25  *
26  * @author Simon Kaufmann - initial contribution and API.
27  *
28  */
29 @NonNullByDefault
30 public class ReadRequestSpecImpl implements InboundSpec {
31     private final String dpt;
32     private final Set<GroupAddress> readAddresses;
33
34     public ReadRequestSpecImpl(GroupAddressConfiguration groupAddressConfiguration, String defaultDPT) {
35         this.dpt = Objects.requireNonNullElse(groupAddressConfiguration.getDPT(), defaultDPT);
36         this.readAddresses = groupAddressConfiguration.getReadGAs();
37     }
38
39     @Override
40     public String getDPT() {
41         return dpt;
42     }
43
44     @Override
45     public Set<GroupAddress> getGroupAddresses() {
46         return readAddresses;
47     }
48 }