Class StringUtils.ObjectStringifier

java.lang.Object
org.apache.empire.commons.StringUtils.ObjectStringifier
Enclosing class:
StringUtils

public static class StringUtils.ObjectStringifier extends Object
ObjectStringifier Converts an object to a String
  • Constructor Details

    • ObjectStringifier

      public ObjectStringifier()
  • Method Details

    • isIgnoreEmpty

      public boolean isIgnoreEmpty(String separator)
      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

      public String toString(Object value, String defValue)
      Convert a single root element
      Parameters:
      value - the value to convert
      defValue - the default value
      Returns:
      the value string
    • toString

      public String toString(Object value, String listTemplate, String defValue)
      Convert a single element inside an array or collection
      Parameters:
      value - the value to convert
      listTemplate - the list template
      defValue - the default value
      Returns:
      the value string
    • estimateBufferSize

      public int estimateBufferSize(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 little
      Parameters:
      value - the value for which to estimate
      defValueLength - the length of the default value
      Returns:
      the estimated buffer size