Class GroovyStyleToString
java.lang.Object
io.restassured.internal.common.util.GroovyStyleToString
Renders values the way a dynamically dispatched
value.toString() does in Groovy, which is what users saw
when this code was written in Groovy. For example a byte[] is rendered as [65, 66] (not [B@1b6d3586),
a map as [a:1] (not {a=1}), a char[] as the string it holds and a DOM element as XML. Values
whose class overrides toString() in a way Groovy can call use their own toString().-
Method Details
-
toString
- Parameters:
value- The value- Returns:
valuerendered like Groovy'svalue.toString().
-
serialize
- Parameters:
element- The element- Returns:
- The element as pretty-printed XML, the same as Groovy's
XmlUtil.serialize(Element).
-
format
Port of Groovy'sInvokerHelper.format(Object, verbose = false), which is what Groovy uses when it casts a value to String or interpolates it in a GString. UnliketoString(Object)it formats every map and collection, even one whose class has its owntoString().- Parameters:
value- The value- Returns:
valueformatted like Groovy'sInvokerHelper.format(value, false).
-