Class SizeOfPolicyConfiguration

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class SizeOfPolicyConfiguration
    extends java.lang.Object
    implements java.lang.Cloneable
    Class to hold the SizeOf policy configuration.
    Author:
    Ludovic Orban
    • Constructor Detail

      • SizeOfPolicyConfiguration

        public SizeOfPolicyConfiguration()
    • 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:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object