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