public List<RouteEntity> getRoutesInBase() { List<RouteEntity> routesAll = routeSessionBean.retrieveAllRoutes(); List<RouteEntity> connectionsAll = routeSessionBean.filterRoutesToConnections(routesAll); routesInBase = new ArrayList<>(); if (staff.getBase() == null) { System.err.println("Null base"); return null; } for (RouteEntity r : connectionsAll) { if (r.getOriginAirport().equals(staff.getBase()) || r.getDestinationAirport().equals(staff.getBase())) { System.err.println("route is " + r); routesInBase.add(r); } } if (routesInBase.isEmpty()) return null; return routesInBase; }
public RouteEntity getRoute() { if (routeSessionBean.getRouteForPreference() == null) { return null; } return routeSessionBean.getRouteForPreference(); }