0

I am getting a list of objects in JSON form. After storing this list I need to be able to search/sort this list by any attribute of it. For example, My data is product data, and products have a price attribute. Is there any library that helps with sorting by price and/or searching by product name?

Hashem
  • 31
  • 1
  • 6

1 Answers1

1

you should decomposite task on few:

  1. Parse JSON data to java objects. (GSON lib) some examples here

  2. Sort list. It is simple task. For example you can use Collections.sort(List<T> var0, Comparator<? super T> var1) from java.util package some examples here

  3. Search by list. It is simple task too. You can use for example stream().filter. some examples here

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92