Class ObjectUtils

java.lang.Object
io.qameta.allure.util.ObjectUtils

public final class ObjectUtils extends Object
Utility methods for safe object string conversion.

Use these helpers from integrations and attachment builders when values may be arrays, maps, null, or objects whose toString() method can fail.

  • Method Details

    • toString

      public static String toString(Object object)
      Converts and returns the string. Pretty prints arrays and guards against failing toString() implementations.
      Parameters:
      object - the object to convert
      Returns:
      a string representation of this object
    • mapToString

      public static String mapToString(Map<String,String> map)
      Returns the map to string.
      Parameters:
      map - the map
      Returns:
      the map to string