Package com.evolveum.midpoint.util
Class DebugUtil
java.lang.Object
com.evolveum.midpoint.util.DebugUtil
- Author:
- semancik
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringBuilder
createIndentedStringBuilder
(int indent) static StringBuilder
createTitleStringBuilder
(Class<?> titleClass, int indent) static StringBuilder
createTitleStringBuilder
(String label, int indent) static StringBuilder
createTitleStringBuilderLn
(Class<?> titleClass, int indent) static String
static String
debugDump
(DebugDumpable dd, int indent) static String
static void
debugDump
(StringBuilder sb, Collection<?> dumpables, int indent, boolean openCloseSymbols) static void
debugDump
(StringBuilder sb, Collection<?> dumpables, int indent, boolean openCloseSymbols, String dumpSuffix) static String
debugDump
(Collection<?> dumpables) static String
debugDump
(Collection<?> dumpables, int indent) static String
debugDump
(Collection<?> dumpables, int indent, boolean openCloseSymbols) static String
static void
debugDumpLabel
(StringBuilder sb, String label, int indent) static void
debugDumpLabelLn
(StringBuilder sb, String label, int indent) static Object
debugDumpLazily
(DebugDumpable dumpable) static Object
debugDumpLazily
(DebugDumpable dumpable, int indent) static Object
debugDumpLazily
(Collection<?> dumpables) static Object
debugDumpLazily
(Collection<?> dumpables, int indent) static Object
debugDumpLazily
(Map<?, ?> dumpables, int indent) static <K,
V> void debugDumpMapMultiLine
(StringBuilder sb, Map<K, V> map, int indent) static <K,
V> void debugDumpMapMultiLine
(StringBuilder sb, Map<K, V> map, int indent, boolean openCloseSymbols) static <K,
V> void debugDumpMapMultiLine
(StringBuilder sb, Map<K, V> map, int indent, boolean openCloseSymbols, String dumpSuffix) static <K,
V> String debugDumpMapMultiLine
(Map<K, V> map) static <K,
V> Object debugDumpMapMultiLineLazily
(Map<K, V> map) static <K,
V> void debugDumpMapSingleLine
(StringBuilder sb, Map<K, V> map, int indent) static void
debugDumpShortWithLabel
(StringBuilder sb, String label, ShortDumpable sd, int indent) static void
debugDumpShortWithLabelLn
(StringBuilder sb, String label, ShortDumpable sd, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, DebugDumpable dd, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, Boolean val, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, Class val, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, Enum<?> val, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, Number val, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, String val, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, Collection<?> values, int indent) static <K,
V> void debugDumpWithLabel
(StringBuilder sb, String label, Map<K, V> map, int indent) static void
debugDumpWithLabel
(StringBuilder sb, String label, QName val, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, DebugDumpable dd, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, Boolean val, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, Class val, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, Enum<?> val, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, Number val, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, String val, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, Collection<?> values, int indent) static <K,
V> void debugDumpWithLabelLn
(StringBuilder sb, String label, Map<K, V> map, int indent) static void
debugDumpWithLabelLn
(StringBuilder sb, String label, QName val, int indent) static void
debugDumpWithLabelShortDump
(StringBuilder sb, String label, ShortDumpable object, int indent) static void
debugDumpWithLabelShortDumpLn
(StringBuilder sb, String label, ShortDumpable object, int indent) static void
debugDumpWithLabelToString
(StringBuilder sb, String label, Object object, int indent) static void
debugDumpWithLabelToStringLn
(StringBuilder sb, String label, Object object, int indent) static String
dump
(DebugDumpable dumpable) static String
static String
static void
dumpObjectSizeEstimate
(StringBuilder sb, String label, Serializable o, int indent) static void
dumpObjectSizeEstimateLn
(StringBuilder sb, String label, Serializable o, int indent) static void
dumpThrowable
(StringBuilder sb, String label, Throwable throwable, int indent, boolean printStackTrace) Dumps a throwable.static int
static String
static String
fixIndentInMultiline
(int indent, String indentString, String s) static String
formatDate
(Long millis) static String
formatElementName
(QName elementName) static String
getCollectionClosingSymbol
(Collection<?> col) static String
getCollectionOpeningSymbol
(Collection<?> col) static String
static String
getPrettyPrintBeansAs
(String defaultLanguage) static void
indentDebugDump
(StringBuilder sb, int indent) static boolean
static Object
static void
setDetailedDebugDump
(boolean detailedDebugDump) static void
setPrettyPrintBeansAs
(String language) static String
static void
shortDump
(StringBuilder sb, ShortDumpable sd) static void
shortDump
(StringBuilder sb, Collection<? extends ShortDumpable> sds) static void
shortDumpAppendProperty
(StringBuilder sb, String propName, Object propValue) static <T> void
shortDumpCollectionPrettyPrintOptionalBrackets
(StringBuilder sb, List<T> values) static Object
shortDumpLazily
(ShortDumpable dumpable) static void
static String
shortenUrl
(String prefix, String fullUrl) static String
standardDebugDump
(Object object, int indent, Object... params) Facilitates implementing common-case debugDump() method.static void
toStringCollection
(StringBuilder sb, Collection<?> values, int indent) static @NotNull String
toStringCollection
(Collection<?> values, int indent) static @NotNull Object
toStringCollectionLazy
(Collection<?> values, int indent) static Object
toStringLazily
(Object object) static <T> String
valueAndClass
(T value)
-
Constructor Details
-
DebugUtil
public DebugUtil()
-
-
Method Details
-
isDetailedDebugDump
public static boolean isDetailedDebugDump() -
setDetailedDebugDump
public static void setDetailedDebugDump(boolean detailedDebugDump) -
getPrettyPrintBeansAs
-
getPrettyPrintBeansAs
-
setPrettyPrintBeansAs
-
formatElementName
-
dump
-
dump
-
debugDump
-
debugDump
-
debugDump
-
debugDump
-
debugDump
public static void debugDump(StringBuilder sb, Collection<?> dumpables, int indent, boolean openCloseSymbols) -
debugDump
public static void debugDump(StringBuilder sb, Collection<?> dumpables, int indent, boolean openCloseSymbols, String dumpSuffix) -
debugDump
-
debugDump
-
debugDump
-
debugDumpLabel
-
debugDumpLabelLn
-
debugDumpWithLabelLn
public static void debugDumpWithLabelLn(StringBuilder sb, String label, DebugDumpable dd, int indent) -
debugDumpWithLabel
-
debugDumpShortWithLabelLn
public static void debugDumpShortWithLabelLn(StringBuilder sb, String label, ShortDumpable sd, int indent) -
debugDumpShortWithLabel
public static void debugDumpShortWithLabel(StringBuilder sb, String label, ShortDumpable sd, int indent) -
debugDumpWithLabel
-
debugDumpWithLabelLn
-
debugDumpWithLabelLn
-
debugDumpWithLabel
-
debugDumpWithLabel
-
debugDumpWithLabelLn
-
debugDumpWithLabel
-
debugDumpWithLabelLn
-
debugDumpWithLabel
-
debugDumpWithLabelLn
-
debugDumpWithLabel
-
debugDumpWithLabelLn
-
debugDumpWithLabel
public static void debugDumpWithLabel(StringBuilder sb, String label, Collection<?> values, int indent) -
debugDumpWithLabelLn
public static void debugDumpWithLabelLn(StringBuilder sb, String label, Collection<?> values, int indent) -
debugDumpWithLabel
public static <K,V> void debugDumpWithLabel(StringBuilder sb, String label, Map<K, V> map, int indent) -
debugDumpWithLabelLn
public static <K,V> void debugDumpWithLabelLn(StringBuilder sb, String label, Map<K, V> map, int indent) -
debugDumpWithLabelToString
public static void debugDumpWithLabelToString(StringBuilder sb, String label, Object object, int indent) -
debugDumpWithLabelToStringLn
public static void debugDumpWithLabelToStringLn(StringBuilder sb, String label, Object object, int indent) -
debugDumpWithLabelShortDump
public static void debugDumpWithLabelShortDump(StringBuilder sb, String label, ShortDumpable object, int indent) -
debugDumpWithLabelShortDumpLn
public static void debugDumpWithLabelShortDumpLn(StringBuilder sb, String label, ShortDumpable object, int indent) -
getCollectionOpeningSymbol
-
getCollectionClosingSymbol
-
indentDebugDump
-
createIndentedStringBuilder
-
createTitleStringBuilderLn
-
createTitleStringBuilder
-
createTitleStringBuilder
-
debugDumpMapMultiLine
-
debugDumpMapMultiLineLazily
-
debugDumpMapMultiLine
-
debugDumpMapMultiLine
public static <K,V> void debugDumpMapMultiLine(StringBuilder sb, Map<K, V> map, int indent, boolean openCloseSymbols) -
debugDumpMapMultiLine
public static <K,V> void debugDumpMapMultiLine(StringBuilder sb, Map<K, V> map, int indent, boolean openCloseSymbols, String dumpSuffix) -
debugDumpMapSingleLine
-
valueAndClass
-
formatDate
-
excerpt
-
fixIndentInMultiline
-
estimateObjectSize
-
dumpObjectSizeEstimateLn
public static void dumpObjectSizeEstimateLn(StringBuilder sb, String label, Serializable o, int indent) -
dumpObjectSizeEstimate
public static void dumpObjectSizeEstimate(StringBuilder sb, String label, Serializable o, int indent) -
dumpObjectFieldsSizeEstimate
-
debugDumpLazily
-
debugDumpLazily
-
toStringLazily
-
lazy
-
debugDumpLazily
-
debugDumpLazily
-
debugDumpLazily
-
shortDump
-
shortDump
-
shortDump
-
shortDumpLazily
-
shortenUrl
-
shortDumpAppendProperty
-
shortDumpRemoveLastComma
-
shortDumpCollectionPrettyPrintOptionalBrackets
public static <T> void shortDumpCollectionPrettyPrintOptionalBrackets(StringBuilder sb, List<T> values) -
dumpThrowable
public static void dumpThrowable(StringBuilder sb, String label, Throwable throwable, int indent, boolean printStackTrace) Dumps a throwable. This is aligned with the need of operation result dumping, so it may not be universally applicable. But it should be good enough. -
toStringCollection
-
toStringCollection
-
toStringCollectionLazy
-
standardDebugDump
Facilitates implementing common-case debugDump() method. Very primitive implementation for now.
-