Class SLogger.Formatter
- java.lang.Object
-
- com.identityworksllc.iiq.common.logging.SLogger.Formatter
-
- Enclosing class:
- SLogger
public static class SLogger.Formatter extends Object implements Supplier<String>
Helper class to format an object for logging.The format is only derived when the
toString()
is called, meaning that if you log one of these and the log level is not enabled, a slow string conversion will never occur.Null values are transformed into the special string ‘(null)’.
Formatted values are cached after the first format operation, even if the underlying object is modified.
The following types are handled by the Formatter:
- null
- Strings
- Arrays of Objects
- Arrays of StackTraceElements
- Collections of Objects
- Maps
- Dates and Calendars
- XML
Document
s - Various SailPointObjects
Nested objects are also passed through a Formatter.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
get()
Returns the formatted string of the item when invoked via theSupplier
interfaceString
toString()
If the formatted value exists, the cached version will be returned.
-
-
-
Method Detail
-
get
public String get()
Returns the formatted string of the item when invoked via theSupplier
interface- Specified by:
get
in interfaceSupplier<String>
- Returns:
- The formatted string
- See Also:
Supplier.get()
-
toString
public String toString()
If the formatted value exists, the cached version will be returned.Otherwise, the format string will be calculated at this time, cached, and then returned.
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-