Package org.robolectric.annotation
Annotation Type Implementation
Indicates that a method declaration is intended to shadow a method with the same signature on the
associated Android class.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionint
The annotated shadow method will be invoked only for the specified SDK or lesser.The implemented method name.int
The annotated shadow method will be invoked only for the specified SDK or greater. -
Field Summary
-
Field Details
-
DEFAULT_SDK
static final int DEFAULT_SDK- See Also:
-
-
Element Details
-
minSdk
int minSdkThe annotated shadow method will be invoked only for the specified SDK or greater.- Default:
- -1
-
maxSdk
int maxSdkThe annotated shadow method will be invoked only for the specified SDK or lesser.- Default:
- -1
-
methodName
String methodNameThe implemented method name.Sometimes internal methods return different types for different SDKs. It's safe because these methods are internal/private methods, not public methods. To support different return types of a method for different SDKs, we often use looseSignature method, although all return types are common types like bool and int. This field/property can be used to fix this issue by using different real methods for different SDKs.
- Returns:
- The expected implemented method name. If it is empty/null, the Robolectric will uses the method's name that marked by @Implementation as the implemented method name.
- Default:
- ""
-