Package com.almis.awe.model.util.data
Class ListUtil
java.lang.Object
com.almis.awe.model.util.data.ListUtil
Utilities for lists
-
Method Summary
Modifier and TypeMethodDescriptioncopyDataListRows
(List<Map<String, CellData>> sourceRows) Get a copy of a list of map of CellDatastatic <T extends Copyable>
TcopyElement
(T element) Copy a single elementGet a copy of a liststatic <T> List<T>
Get a copy of a listGet a copy of a mapGet a copy of a mapstatic <T> List<T>
readList
(ObjectInputStream in, Class<T> clazz) Deserialize listreadMap
(ObjectInputStream in, Class<T> clazz) Deserialize liststatic <T> void
writeList
(ObjectOutputStream out, List<T> list) Serialize liststatic <T> void
writeMap
(ObjectOutputStream out, Map<String, T> map) Serialize list
-
Method Details
-
copyElement
Copy a single element- Type Parameters:
T
- Element class- Parameters:
element
- Element to copy- Returns:
- Copy of element
-
copyList
Get a copy of a list- Type Parameters:
T
- Element type- Parameters:
source
- Source listclazz
- Element class- Returns:
- Copied list
-
copyList
Get a copy of a list- Type Parameters:
T
- Element type- Parameters:
source
- Source list- Returns:
- Copied list
-
copyMap
Get a copy of a map- Type Parameters:
T
- Element type- Parameters:
source
- Source mapclazz
- Element class- Returns:
- Copied map
-
copyMap
Get a copy of a map- Type Parameters:
T
- Element type- Parameters:
source
- Source map- Returns:
- Copied map
-
copyDataListRows
Get a copy of a list of map of CellData- Parameters:
sourceRows
-
-
writeList
Serialize list- Type Parameters:
T
- Class- Parameters:
out
- Output streamlist
- List- Throws:
IOException
- Error accessing to IO
-
readList
public static <T> List<T> readList(ObjectInputStream in, Class<T> clazz) throws IOException, ClassNotFoundException Deserialize list- Type Parameters:
T
- class type- Parameters:
in
- Input streamclazz
- class- Returns:
- deserialize list
- Throws:
IOException
- IO exceptionClassNotFoundException
- Class not found exception
-
writeMap
Serialize list- Type Parameters:
T
- Class- Parameters:
out
- Output streammap
- List- Throws:
IOException
- Error accessing to IO
-
readMap
public static <T> Map<String,T> readMap(ObjectInputStream in, Class<T> clazz) throws IOException, ClassNotFoundException Deserialize list- Type Parameters:
T
- type class- Parameters:
in
- Input streamclazz
- Class- Returns:
- Map
- Throws:
IOException
- Error accessing to IOClassNotFoundException
- Class not found
-