Class SpreadsheetUtils
- java.lang.Object
-
- org.eclipse.epsilon.emc.spreadsheets.SpreadsheetUtils
-
public class SpreadsheetUtils extends Object
This class provides support methods.- Author:
- Martins Francis
-
-
Constructor Summary
Constructors Constructor Description SpreadsheetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>
convertObjectToList(Object value)
This method creates list representation of the given object.static String
convertObjectToString(SpreadsheetColumn column, Object inputValue)
This method creates a string representation of the given object.static List<SpreadsheetRow>
extractAllRowsFromObject(Object object)
This method returns all SpreadsheetRow instances contained by the given object.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.static String
getValueConformingToDataType(SpreadsheetColumn column, String value)
static void
removeFirst(StringBuilder sb, String leadingChars)
static void
removeFirstChar(StringBuilder sb)
static void
removeLast(StringBuilder sb, String trailingChars)
static void
removeLastChar(StringBuilder sb)
-
-
-
Method Detail
-
removeFirstChar
public static void removeFirstChar(StringBuilder sb)
-
removeFirst
public static void removeFirst(StringBuilder sb, String leadingChars)
-
removeLastChar
public static void removeLastChar(StringBuilder sb)
-
removeLast
public static void removeLast(StringBuilder sb, String trailingChars)
-
getValueConformingToDataType
public static String getValueConformingToDataType(SpreadsheetColumn column, String value)
-
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
-
-