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.deutschebahn.internal;
15 import java.util.List;
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;
23 * Selection of an attribute within a {@link TimetableStop} that provides a channel {@link State}.
25 * @author Sönke Küper - Initial contribution
28 public interface AttributeSelection {
31 * Returns the value for this attribute.
34 Object getValue(TimetableStop stop);
37 * Returns the {@link State} that should be set for the channels'value for this attribute.
40 State getState(TimetableStop stop);
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.
46 List<String> getStringValues(TimetableStop t);