]> git.basschouten.com Git - openhab-addons.git/blob
cc610c92e328f23937d45dbe1bf76a741c09cb88
[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.deutschebahn.internal;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.deutschebahn.internal.timetable.dto.TimetableStop;
20 import org.openhab.core.types.State;
21
22 /**
23  * Selection of an attribute within a {@link TimetableStop} that provides a channel {@link State}.
24  * 
25  * @author Sönke Küper - Initial contribution
26  */
27 @NonNullByDefault
28 public interface AttributeSelection {
29
30     /**
31      * Returns the value for this attribute.
32      */
33     @Nullable
34     Object getValue(TimetableStop stop);
35
36     /**
37      * Returns the {@link State} that should be set for the channels'value for this attribute.
38      */
39     @Nullable
40     State getState(TimetableStop stop);
41
42     /**
43      * Returns a list of values as string list.
44      * Returns empty list if value is not present, singleton list if attribute is not single-valued.
45      */
46     List<String> getStringValues(TimetableStop t);
47 }