Class JMemoryBuddy

    • Constructor Summary

      Constructors 
      Constructor Description
      JMemoryBuddy()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertCollectable​(java.lang.ref.WeakReference weakReference)
      Checks whether the content of the WeakReference can be collected.
      static void assertNotCollectable​(java.lang.ref.WeakReference weakReference)
      Checks whether the content of the WeakReference can not be collected.
      static boolean checkCollectable​(java.lang.ref.WeakReference weakReference)
      Checks whether the content of the WeakReference can be collected.
      static boolean checkNotCollectable​(java.lang.ref.WeakReference weakReference)
      Checks whether the content of the WeakReference can not be collected.
      static void memoryTest​(java.util.function.Consumer<JMemoryBuddy.MemoryTestAPI> f)
      A standard method to define a test which checks code for specific memory semantic.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JMemoryBuddy

        public JMemoryBuddy()
    • Method Detail

      • assertCollectable

        public static void assertCollectable​(java.lang.ref.WeakReference weakReference)
        Checks whether the content of the WeakReference can be collected.
        Parameters:
        weakReference - The WeakReference to check.
      • checkCollectable

        public static boolean checkCollectable​(java.lang.ref.WeakReference weakReference)
        Checks whether the content of the WeakReference can be collected.
        Parameters:
        weakReference - The WeakReference to check.
        Returns:
        Returns true, when the provided WeakReference can be collected.
      • assertNotCollectable

        public static void assertNotCollectable​(java.lang.ref.WeakReference weakReference)
        Checks whether the content of the WeakReference can not be collected.
        Parameters:
        weakReference - The WeakReference to check.
      • checkNotCollectable

        public static boolean checkNotCollectable​(java.lang.ref.WeakReference weakReference)
        Checks whether the content of the WeakReference can not be collected.
        Parameters:
        weakReference - The WeakReference to check.
        Returns:
        Returns true, when the provided WeakReference can be collected.
      • memoryTest

        public static void memoryTest​(java.util.function.Consumer<JMemoryBuddy.MemoryTestAPI> f)
        A standard method to define a test which checks code for specific memory semantic. The parameter of the lambda provides an API to define the required memory semantic.
        Parameters:
        f - A function which get's executed with the API to define the required memory semantic.