Package 

Class AndroidMockKMap

  • All Implemented Interfaces:
    java.util.Map

    
    public class AndroidMockKMap
    extends ReferenceQueue<Object> implements Map<Object, MockKInvocationHandler>
                        

    A map mock -> adapter that holds weak references to the mocks and cleans them up when a stale reference is found.

    • Method Summary

      Modifier and Type Method Description
      int size()
      boolean isEmpty()
      boolean containsKey(Object mock)
      boolean containsValue(Object adapter)
      MockKInvocationHandler get(Object mock)
      MockKInvocationHandler put(Object mock, MockKInvocationHandler adapter)
      MockKInvocationHandler remove(Object mock)
      void putAll(Map<out Object, out MockKInvocationHandler> map)
      void clear()
      Set<Object> keySet()
      Collection<MockKInvocationHandler> values()
      Set<Map.Entry<Object, MockKInvocationHandler>> entrySet()
      boolean isInternalHashMap(Object instance)
      • Methods inherited from class java.lang.ref.ReferenceQueue

        poll, remove
      • Methods inherited from class java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, ofEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait