Package net.sf.ehcache.config
Class SizeOfPolicyConfiguration
- java.lang.Object
-
- net.sf.ehcache.config.SizeOfPolicyConfiguration
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SizeOfPolicyConfiguration extends java.lang.Object implements java.lang.CloneableClass to hold the SizeOf policy configuration.- Author:
- Ludovic Orban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSizeOfPolicyConfiguration.MaxDepthExceededBehaviorEnum of the possible behaviors of the SizeOf engine when the max depth is exceeded
-
Field Summary
Fields Modifier and Type Field Description static SizeOfPolicyConfiguration.MaxDepthExceededBehaviorDEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIORDefault max traversal depth exceeded behaviorstatic intDEFAULT_MAX_SIZEOF_DEPTHDefault max traversal depth
-
Constructor Summary
Constructors Constructor Description SizeOfPolicyConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)intgetMaxDepth()Gets the maximum depth the SizeOf engine can normally traverseSizeOfPolicyConfiguration.MaxDepthExceededBehaviorgetMaxDepthExceededBehavior()Gets the behavior of the SizeOf engine when the max depth is reachedinthashCode()SizeOfPolicyConfigurationmaxDepth(int maxDepth)Builder method to set the maximum depth the SizeOf engine can normally traverseSizeOfPolicyConfigurationmaxDepthExceededBehavior(java.lang.String maxDepthExceededBehavior)Builder method to set the behavior of the SizeOf engine when the max depth is reached using a String objectSizeOfPolicyConfigurationmaxDepthExceededBehavior(SizeOfPolicyConfiguration.MaxDepthExceededBehavior maxDepthExceededBehavior)Builder method to set the behavior of the SizeOf engine when the max depth is reachedstatic SizeOfPolicyConfiguration.MaxDepthExceededBehaviorresolveBehavior(Ehcache cache)Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured on the cache itself.static intresolveMaxDepth(Ehcache cache)Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured on the cache itself.voidsetMaxDepth(int maxDepth)Sets the maximum depth the SizeOf engine can normally traversevoidsetMaxDepthExceededBehavior(java.lang.String maxDepthExceededBehavior)Sets the behavior of the SizeOf engine when the max depth is reached
-
-
-
Field Detail
-
DEFAULT_MAX_SIZEOF_DEPTH
public static final int DEFAULT_MAX_SIZEOF_DEPTH
Default max traversal depth- See Also:
- Constant Field Values
-
DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR
public static final SizeOfPolicyConfiguration.MaxDepthExceededBehavior DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR
Default max traversal depth exceeded behavior
-
-
Method Detail
-
getMaxDepth
public int getMaxDepth()
Gets the maximum depth the SizeOf engine can normally traverse- Returns:
- the maximum depth the SizeOf engine can normally traverse
-
setMaxDepth
public void setMaxDepth(int maxDepth)
Sets the maximum depth the SizeOf engine can normally traverse- Parameters:
maxDepth- the maximum depth the SizeOf engine can normally traverse
-
maxDepth
public SizeOfPolicyConfiguration maxDepth(int maxDepth)
Builder method to set the maximum depth the SizeOf engine can normally traverse- Parameters:
maxDepth- the maximum depth the SizeOf engine can normally traverse- Returns:
- this SizeOfPolicyConfiguration object
-
getMaxDepthExceededBehavior
public SizeOfPolicyConfiguration.MaxDepthExceededBehavior getMaxDepthExceededBehavior()
Gets the behavior of the SizeOf engine when the max depth is reached- Returns:
- the behavior of the SizeOf engine when the max depth is reached
-
setMaxDepthExceededBehavior
public void setMaxDepthExceededBehavior(java.lang.String maxDepthExceededBehavior)
Sets the behavior of the SizeOf engine when the max depth is reached- Parameters:
maxDepthExceededBehavior- the behavior of the SizeOf engine when the max depth is reached
-
maxDepthExceededBehavior
public SizeOfPolicyConfiguration maxDepthExceededBehavior(SizeOfPolicyConfiguration.MaxDepthExceededBehavior maxDepthExceededBehavior)
Builder method to set the behavior of the SizeOf engine when the max depth is reached- Parameters:
maxDepthExceededBehavior- the behavior of the SizeOf engine when the max depth is reached- Returns:
- this SizeOfPolicyConfiguration object
-
maxDepthExceededBehavior
public SizeOfPolicyConfiguration maxDepthExceededBehavior(java.lang.String maxDepthExceededBehavior)
Builder method to set the behavior of the SizeOf engine when the max depth is reached using a String object- Parameters:
maxDepthExceededBehavior- the behavior of the SizeOf engine when the max depth is reached- Returns:
- this SizeOfPolicyConfiguration object
-
resolveMaxDepth
public static int resolveMaxDepth(Ehcache cache)
Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured on the cache itself.- Parameters:
cache- the cache from which to resolve the max depth- Returns:
- the resolved max depth
-
resolveBehavior
public static SizeOfPolicyConfiguration.MaxDepthExceededBehavior resolveBehavior(Ehcache cache)
Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured on the cache itself.- Parameters:
cache- the cache from which to resolve the MaxDepthExceededBehavior- Returns:
- the resolved MaxDepthExceededBehavior
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-