public class DefaultSizeOfEngine extends java.lang.Object implements SizeOfEngine
Modifier and Type | Field and Description |
---|---|
private boolean |
abortWhenMaxDepthExceeded |
private static SizeOfFilter |
DEFAULT_FILTER |
private static org.slf4j.Logger |
LOG |
private int |
maxDepth |
private SizeOf |
sizeOf |
private static boolean |
USE_VERBOSE_DEBUG_LOGGING |
static java.lang.String |
USER_FILTER_RESOURCE
System property defining a user specific resource based size-of filter.
|
private static java.lang.String |
VERBOSE_DEBUG_LOGGING |
Modifier | Constructor and Description |
---|---|
private |
DefaultSizeOfEngine(DefaultSizeOfEngine defaultSizeOfEngine,
int maxDepth,
boolean abortWhenMaxDepthExceeded) |
|
DefaultSizeOfEngine(int maxDepth,
boolean abortWhenMaxDepthExceeded)
Creates a default size of engine using the best available sizing algorithm.
|
Modifier and Type | Method and Description |
---|---|
SizeOfEngine |
copyWith(int maxDepth,
boolean abortWhenMaxDepthExceeded)
Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parameters
|
private static SizeOfFilter |
getUserFilter() |
private static boolean |
getVerboseSizeOfDebugLogging() |
Size |
sizeOf(java.lang.Object key,
java.lang.Object value,
java.lang.Object container)
Size an element
|
public static final java.lang.String USER_FILTER_RESOURCE
The resource pointed to by this property must be a list of fully qualified field or class names, one per line:
# This is a comment org.mycompany.domain.MyType org.mycompany.domain.MyOtherType.myFieldFields or types matching against lines in this resource will be ignored when calculating the size of the object graph.
private static final org.slf4j.Logger LOG
private static final java.lang.String VERBOSE_DEBUG_LOGGING
private static final SizeOfFilter DEFAULT_FILTER
private static final boolean USE_VERBOSE_DEBUG_LOGGING
private final SizeOf sizeOf
private final int maxDepth
private final boolean abortWhenMaxDepthExceeded
public DefaultSizeOfEngine(int maxDepth, boolean abortWhenMaxDepthExceeded)
maxDepth
- the max object graph that will be traversed.abortWhenMaxDepthExceeded
- true if the object traversal should be aborted when the max depth is exceededprivate DefaultSizeOfEngine(DefaultSizeOfEngine defaultSizeOfEngine, int maxDepth, boolean abortWhenMaxDepthExceeded)
public SizeOfEngine copyWith(int maxDepth, boolean abortWhenMaxDepthExceeded)
copyWith
in interface SizeOfEngine
maxDepth
- maximum depth of the object graph to traverseabortWhenMaxDepthExceeded
- true if the object traversal should be aborted when the max depth is exceededprivate static SizeOfFilter getUserFilter()
private static boolean getVerboseSizeOfDebugLogging()
public Size sizeOf(java.lang.Object key, java.lang.Object value, java.lang.Object container)
sizeOf
in interface SizeOfEngine
key
- the key of the elementvalue
- the value of the elementcontainer
- the container of the element, ie: element object + eventual overhead