@Override public List<BusInfo> getAll() { List<BusInfo> list; if ((list = busInfoRepo.findAll()).isEmpty()) { LOGGER.warn("Cant find any Bus in class: " + getClass().getName()); } return list; }
@Override public Map<Integer, String> getAllBusNumber() { Map<Integer, String> list = new HashMap<>(); for (String s : busInfoRepo.getAllBusNumber()) { list.put(list.size() + 1, s); } return list; }
@Override public BusInfo getByDriverPhone(String phone) { BusInfo busInfo; if ((busInfo = busInfoRepo.getBusByDriverPhone(phone)) == null) { LOGGER.warn( "Not find any Bus for driver phone:" + phone + ". In class: " + getClass().getName()); busInfo = new BusInfo(); } return busInfo; }