public class DefaultSizeOfEngineConfiguration extends java.lang.Object implements ServiceConfiguration<SizeOfEngineProvider,DefaultSizeOfEngineConfiguration>
ServiceConfiguration
for the default SizeOfEngineProvider
.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MAX_OBJECT_SIZE
Default maximum object size after which sizing stops
|
static int |
DEFAULT_OBJECT_GRAPH_SIZE
Default maximum object graph count after which sizing stops
|
static MemoryUnit |
DEFAULT_UNIT
Default maximum object size unit after which sizing stops
|
Constructor and Description |
---|
DefaultSizeOfEngineConfiguration(long size,
MemoryUnit unit,
long objectGraphSize)
Creates a new configuration object with the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
DefaultSizeOfEngineConfiguration |
build(DefaultSizeOfEngineConfiguration config)
Construct a new configuration from the given detached representation.
|
DefaultSizeOfEngineConfiguration |
derive()
Derive a detached representation from this configuration
|
long |
getMaxObjectGraphSize()
Returns the maximum object graph size before aborting sizing.
|
long |
getMaxObjectSize()
Returns the maximum object size before aborting sizing.
|
java.lang.Class<SizeOfEngineProvider> |
getServiceType()
Indicates which service this configuration works with.
|
MemoryUnit |
getUnit()
Returns the maximum object size unit.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compatibleWith
public static final int DEFAULT_OBJECT_GRAPH_SIZE
public static final long DEFAULT_MAX_OBJECT_SIZE
public static final MemoryUnit DEFAULT_UNIT
public DefaultSizeOfEngineConfiguration(long size, MemoryUnit unit, long objectGraphSize)
size
- the maximum object sizeunit
- the object size unitobjectGraphSize
- the maximum object graph sizepublic java.lang.Class<SizeOfEngineProvider> getServiceType()
getServiceType
in interface ServiceConfiguration<SizeOfEngineProvider,DefaultSizeOfEngineConfiguration>
public long getMaxObjectGraphSize()
This measure is a count of different instances that have to be sized from the root of the graph. That is a collection with 1000 identical elements will count as two objects, while a collection with 1000 different elements will count as 1001 objects.
public long getMaxObjectSize()
This value applies to the sum of the size of objects composing the graph being sized.
getUnit()
public MemoryUnit getUnit()
getMaxObjectSize()
public DefaultSizeOfEngineConfiguration derive()
ServiceConfiguration
derive
in interface ServiceConfiguration<SizeOfEngineProvider,DefaultSizeOfEngineConfiguration>
public DefaultSizeOfEngineConfiguration build(DefaultSizeOfEngineConfiguration config)
ServiceConfiguration
build
in interface ServiceConfiguration<SizeOfEngineProvider,DefaultSizeOfEngineConfiguration>
config
- a detached representation