Package org.apache.empire.commons
Class StringUtils.ObjectStringifier
java.lang.Object
org.apache.empire.commons.StringUtils.ObjectStringifier
- Enclosing class:
- StringUtils
ObjectStringifier
Converts an object to a String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintestimateBufferSize(Object value, int defValueLength) Estimates the buffer size required for the target String This function should be fast and rather estimate to much than to littlebooleanisIgnoreEmpty(String separator) Returns whether or not to ignore empty values in arraysConvert a single root elementConvert a single element inside an array or collection
-
Constructor Details
-
ObjectStringifier
public ObjectStringifier()
-
-
Method Details
-
isIgnoreEmpty
Returns whether or not to ignore empty values in arrays- Parameters:
separator- the list separator- Returns:
- true if empty values should be treated as non-existent or false otherwise
-
toString
Convert a single root element- Parameters:
value- the value to convertdefValue- the default value- Returns:
- the value string
-
toString
Convert a single element inside an array or collection- Parameters:
value- the value to convertlistTemplate- the list templatedefValue- the default value- Returns:
- the value string
-
estimateBufferSize
Estimates the buffer size required for the target String This function should be fast and rather estimate to much than to little- Parameters:
value- the value for which to estimatedefValueLength- the length of the default value- Returns:
- the estimated buffer size
-