Class SpreadsheetUtils


  • public class SpreadsheetUtils
    extends Object
    This class provides support methods.
    Author:
    Martins Francis
    • Constructor Detail

      • SpreadsheetUtils

        public SpreadsheetUtils()
    • Method Detail

      • removeFirstChar

        public static void removeFirstChar​(StringBuilder sb)
      • removeLastChar

        public static void removeLastChar​(StringBuilder sb)
      • extractAllRowsFromObject

        public static List<SpreadsheetRow> extractAllRowsFromObject​(Object object)
        This method returns all SpreadsheetRow instances contained by the given object.
        Parameters:
        object -
        Returns:
        list of SpreadsheetRow instances
      • extractMapFromCollection

        public static Map<String,​Object> extractMapFromCollection​(Collection<Object> collection)
        This method extracts Map from the given collection - it assumes the first object contained by it is a Map. If the collection is empty or null then an empty Map is returned.
        Parameters:
        collection -
        Returns:
        Map
      • convertObjectToString

        public static String convertObjectToString​(SpreadsheetColumn column,
                                                   Object inputValue)
        This method creates a string representation of the given object. If it is an Iterable object then a delimiter separated string is created.
        Parameters:
        column -
        inputValue -
        Returns:
        string representation of the given object
      • convertObjectToList

        public static List<String> convertObjectToList​(Object value)
        This method creates list representation of the given object.
        Parameters:
        column -
        value -
        Returns:
        list representation of the given object