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.deutschebahn.internal;
15 import java.util.function.Predicate;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.deutschebahn.internal.timetable.dto.TimetableStop;
21 * Filter that selects {@link TimetableStop}, if they have an departure or an arrival element (or both).
23 * @author Sönke Küper - initial contribution.
26 public enum TimetableStopFilter implements Predicate<TimetableStop> {
29 * Selects all entries.
33 public boolean test(TimetableStop t) {
39 * Selects only stops with an departure.
43 public boolean test(TimetableStop t) {
44 return t.getDp() != null;
49 * Selects only stops with an arrival.
53 public boolean test(TimetableStop t) {
54 return t.getAr() != null;