Class SingletonHelper


  • @ThreadSafe
    public final class SingletonHelper
    extends Object
    Global singleton utility methods that don't nicely fit somewhere else.
    Author:
    Philip Helger
    • Field Detail

      • DEFAULT_DEBUG_CONSISTENCY

        public static final boolean DEFAULT_DEBUG_CONSISTENCY
      • DEFAULT_DEBUG_WITH_STACK_TRACE

        public static final boolean DEFAULT_DEBUG_WITH_STACK_TRACE
        See Also:
        Constant Field Values
    • Method Detail

      • setDebugConsistency

        public static void setDebugConsistency​(boolean bDebugConsistency)
        Enable or disable singleton consistency debugging.
        Parameters:
        bDebugConsistency - true if the singleton consistency should be debugged, false to disable it.
      • isDebugConsistency

        public static boolean isDebugConsistency()
        Returns:
        true if singleton consistency debugging is enabled, false if it is disabled. The default value is GlobalDebug.isDebugMode().
      • setDebugWithStackTrace

        public static void setDebugWithStackTrace​(boolean bDebugWithStackTrace)
        Enable or disable stack traces when debugging singletons.
        Parameters:
        bDebugWithStackTrace - true to enable stack traces, false to disable them. By default is is disabled.
      • isDebugWithStackTrace

        public static boolean isDebugWithStackTrace()
        Returns:
        true if stack traces should be logged, false if not. The default value is disabled.