Class ListUtil

java.lang.Object
com.almis.awe.model.util.data.ListUtil

public final class ListUtil extends Object
Utilities for lists
  • Method Details

    • copyElement

      public static <T extends Copyable> T copyElement(T element)
      Copy a single element
      Type Parameters:
      T - Element class
      Parameters:
      element - Element to copy
      Returns:
      Copy of element
    • copyList

      public static <T> List<T> copyList(List<T> source, Class<T> clazz)
      Get a copy of a list
      Type Parameters:
      T - Element type
      Parameters:
      source - Source list
      clazz - Element class
      Returns:
      Copied list
    • copyList

      public static <T extends Copyable> List<T> copyList(List<T> source)
      Get a copy of a list
      Type Parameters:
      T - Element type
      Parameters:
      source - Source list
      Returns:
      Copied list
    • copyMap

      public static <T> Map<String,T> copyMap(Map<String,T> source, Class<T> clazz)
      Get a copy of a map
      Type Parameters:
      T - Element type
      Parameters:
      source - Source map
      clazz - Element class
      Returns:
      Copied map
    • copyMap

      public static <T extends Copyable> Map<String,T> copyMap(Map<String,T> source)
      Get a copy of a map
      Type Parameters:
      T - Element type
      Parameters:
      source - Source map
      Returns:
      Copied map
    • copyDataListRows

      public static List<Map<String,CellData>> copyDataListRows(List<Map<String,CellData>> sourceRows)
      Get a copy of a list of map of CellData
      Parameters:
      sourceRows -
    • writeList

      public static <T> void writeList(ObjectOutputStream out, List<T> list) throws IOException
      Serialize list
      Type Parameters:
      T - Class
      Parameters:
      out - Output stream
      list - 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 stream
      clazz - class
      Returns:
      deserialize list
      Throws:
      IOException - IO exception
      ClassNotFoundException - Class not found exception
    • writeMap

      public static <T> void writeMap(ObjectOutputStream out, Map<String,T> map) throws IOException
      Serialize list
      Type Parameters:
      T - Class
      Parameters:
      out - Output stream
      map - 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 stream
      clazz - Class
      Returns:
      Map
      Throws:
      IOException - Error accessing to IO
      ClassNotFoundException - Class not found