java.lang.Object
org.autogui.swing.prefs.GuiSwingPrefsSupports
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
static interface
static class
static class
static class
static interface
partial updaterstatic class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> E
static <E> List
<E> getAsListNonNull
(Object list, Class<E> type) supporting method for setting JSON valuesstatic <E> List
<E> getAsListNonNull
(Map<?, ?> map, Class<E> type, String key) supporting method for setting JSON valuesstatic <E> void
static <E,
V> void static <E,
V> void
-
Constructor Details
-
GuiSwingPrefsSupports
protected GuiSwingPrefsSupports()
-
-
Method Details
-
setAsList
- Type Parameters:
E
- the element type- Parameters:
targetList
- the updated non-null list; cleared and set all elements from the map.map
- the source maptype
- the element typekey
- the key- Since:
- 1.6.1
-
setAsList
public static <E,V> void setAsList(List<V> targetList, Map<?, ?> map, Class<E> type, String key, Function<E, V> mapper) - Type Parameters:
E
- the element type in the JSONV
- the actual element type of the trgetList- Parameters:
targetList
- the updated non-null list; cleared and set all elements from the map.map
- the source maptype
- the element type of the JSON mapkey
- the keymapper
- the mapper from a JSON element to an actual value in the list
-
setAsList
public static <E,V> void setAsList(List<V> targetList, Object list, Class<E> type, Function<E, V> mapper) - Type Parameters:
E
- the element type in the JSONV
- the actual element type of the trgetList- Parameters:
targetList
- the updated non-null list; cleared and set all elements from the list.list
- the source listtype
- the element type of the JSON mapmapper
- the mapper from a JSON element to an actual value in the list
-
getAsListNonNull
supporting method for setting JSON values- Type Parameters:
E
- the element type- Parameters:
map
- the non-null maptype
- the element typekey
- the key for the map- Returns:
- a list of map.get(key) that satifies all elements are the type.
- Since:
- 1.7
-
getAs
- Type Parameters:
E
- the type- Parameters:
map
- the map for gettingtype
- the type instancekey
- the map-keydefVal
- the default value if failure of type check- Returns:
- the non-null map.get(key) or defVal
-
getAsListNonNull
supporting method for setting JSON values- Type Parameters:
E
- the element type- Parameters:
list
- a list (nullable)type
- the element type- Returns:
- the list that satifies all elements are the type, or a new empty list.
- Since:
- 1.7
-