I have an a list of stores(getStore(..))s, which is getting all the stores from DB
what I'm trying to do is to add additional stores from properties file.(trying to build the list)
here's how my properties file look like
yard=1085:BELF:BELGRADE FIXTURES
yard=3238:SKWS:SKOKIE WAREHOUSE
yard=3239:PLDC:PLANO DC
yard=3339:HCDC:HOLIDAY CITY DC
here's how I'm trying to get the list.
@Value("#{'${yard}'.split(',')}#{T(java.util.Collections).emptyList()}")
private List<String> myList;
here how I'm trying to add the additional stores to the list
public List<Store> additionalYardList() {
List<Store> stores = storesApi.getStores();
for (String yard : myList) {
String[] yardArray = yard.split(":");
Store store = new Store();
store.setNumber(Integer.parseInt(yardArray[0]));
store.setAbbr(yardArray[1]);
store.setName(yardArray[2]);
LOG.debug(store.getAbbr());
stores.add(store);
}
return stores;
}
Then will do a Stream to merge
public List<Store> getAllStores() {
return Stream.of(additionalYardList(), storesApi.getStores()).flatMap(List::stream).collect(Collectors.toList());
}
}
My Store object fields are: (number- abbr - name )
Nothing is been added to that list, Any idea what am I missing?