@Test public void getSelections() throws Exception { String selections = "id!name!flat!.id!.name!image!.url!houseList!.name"; Method method = HouseController.class.getMethod("test1"); PojoSelection pojoSelection = SelectionHandler.analyseTypeMapping(method); System.out.println(SelectionHandler.print()); List<String> newSelections = SelectionHandler.getSelections(pojoSelection, selections, null); Assert.assertNotNull(newSelections); System.out.println("Selections: " + newSelections.stream().collect(Collectors.joining(","))); Assert.assertEquals("houseId", newSelections.get(0)); Assert.assertEquals("houseName", newSelections.get(1)); Assert.assertEquals("houseFlat.flatId", newSelections.get(2)); Assert.assertEquals("houseFlat.flatName", newSelections.get(3)); Assert.assertEquals("gallery.url", newSelections.get(4)); Assert.assertEquals("houses.houseName", newSelections.get(5)); newSelections.forEach(System.out::println); }
public static List<String> getSelections() { return THREAD_LOCAL_SELECTIONS.get(); }
SelectionHandler { public static List<String> getSelections() { return THREAD_LOCAL_SELECTIONS.get(); } }
SelectionHandler { public static List<String> getSelections() { return THREAD_LOCAL_SELECTIONS.get(); } private  SelectionHandler(); }
SelectionHandler { public static List<String> getSelections() { return THREAD_LOCAL_SELECTIONS.get(); } private  SelectionHandler(); static List<String> getSelections(); static PojoSelection analyseTypeMapping(Method method); static List<String> getSelections(PojoSelection pojoSelection, String selections, String prefix); static void set(List<String> realSelections); static void clear(); static String print(); }
SelectionHandler { public static List<String> getSelections() { return THREAD_LOCAL_SELECTIONS.get(); } private  SelectionHandler(); static List<String> getSelections(); static PojoSelection analyseTypeMapping(Method method); static List<String> getSelections(PojoSelection pojoSelection, String selections, String prefix); static void set(List<String> realSelections); static void clear(); static String print();  }