public Set<Product> getProductsByPriceFilter(Map<String, String> filterParams) {
Set<Product> products = new HashSet<Product>();
String l = filterParams.get("low");
String h = filterParams.get("high");
BigDecimal floor = new BigDecimal(l);
BigDecimal ceil = new BigDecimal(h);
return products;
}
I have discovered an interesting phenomena. I have filterParams that should <String, String>. However, if I use filterParams.get with an existing key, it returns a Linked List. Where might be the issue?
java.lang.ClassCastException: java.util.LinkedList cannot be cast to java.lang.String
at com.packt.webstore.domain.repositoryImpl.ProductRepositoryImpl.getProductsByPriceFilter(ProductRepositoryImpl.java:103)
Line 103 is String l = filterParams.get("low");
I've tried explicit conversion as well, but it doesn't seem to work.