View Javadoc
1   /*
2    * Copyright (c) 2006 JMockit developers
3    * This file is subject to the terms of the MIT license (see LICENSE.txt).
4    */
5   package mockit.internal.expectations;
6   
7   import edu.umd.cs.findbugs.annotations.NonNull;
8   import edu.umd.cs.findbugs.annotations.Nullable;
9   
10  import java.util.Map;
11  
12  abstract class Phase {
13      @NonNull
14      final PhasedExecutionState executionState;
15  
16      Phase(@NonNull PhasedExecutionState executionState) {
17          this.executionState = executionState;
18      }
19  
20      @NonNull
21      public final Map<Object, Object> getInstanceMap() {
22          return executionState.equivalentInstances.instanceMap;
23      }
24  
25      @NonNull
26      final Map<Object, Object> getReplacementMap() {
27          return executionState.equivalentInstances.replacementMap;
28      }
29  
30      @Nullable
31      abstract Object handleInvocation(@Nullable Object mock, int mockAccess, @NonNull String mockClassDesc,
32              @NonNull String mockNameAndDesc, @Nullable String genericSignature, boolean withRealImpl,
33              @NonNull Object[] args) throws Throwable;
34  }