Package org.robolectric.plugins
Class GetInstallerPackageNameModeConfigurer
java.lang.Object
org.robolectric.plugins.GetInstallerPackageNameModeConfigurer
- All Implemented Interfaces:
Configurer<GetInstallerPackageNameMode.Mode>
@AutoService(Configurer.class) public class GetInstallerPackageNameModeConfigurer extends Object implements Configurer<GetInstallerPackageNameMode.Mode>
Provides configuration to Robolectric for its @
GetInstallerPackageNameMode
annotation.-
Constructor Summary
Constructors Constructor Description GetInstallerPackageNameModeConfigurer()
-
Method Summary
Modifier and Type Method Description GetInstallerPackageNameMode.Mode
defaultConfig()
Returns the default configuration for tests that do not specify a configuration of this type.Class<GetInstallerPackageNameMode.Mode>
getConfigClass()
Retrieve the class type for this ConfigurerGetInstallerPackageNameMode.Mode
getConfigFor(Class<?> testClass)
Returns the configuration for the given class.GetInstallerPackageNameMode.Mode
getConfigFor(Method method)
Returns the configuration for the given method.GetInstallerPackageNameMode.Mode
getConfigFor(String packageName)
Returns the configuration for a given package.GetInstallerPackageNameMode.Mode
merge(GetInstallerPackageNameMode.Mode parentConfig, GetInstallerPackageNameMode.Mode childConfig)
Merges two configurations.
-
Constructor Details
-
GetInstallerPackageNameModeConfigurer
public GetInstallerPackageNameModeConfigurer()
-
-
Method Details
-
getConfigClass
Description copied from interface:Configurer
Retrieve the class type for this Configurer- Specified by:
getConfigClass
in interfaceConfigurer<GetInstallerPackageNameMode.Mode>
-
defaultConfig
Description copied from interface:Configurer
Returns the default configuration for tests that do not specify a configuration of this type.- Specified by:
defaultConfig
in interfaceConfigurer<GetInstallerPackageNameMode.Mode>
-
getConfigFor
Description copied from interface:Configurer
Returns the configuration for a given package.This method will be called once for package in the hierarchy leading to the test class being configured. For example, for
com.example.FooTest
, this method will be called three times with"com.example"
,"@com"
, and""
(representing the top level package).- Specified by:
getConfigFor
in interfaceConfigurer<GetInstallerPackageNameMode.Mode>
- Parameters:
packageName
- the name of the package, or the empty string representing the top level unnamed package- Returns:
- a configuration object, or null if the given properties has no relevant data for this configuration
-
getConfigFor
Description copied from interface:Configurer
Returns the configuration for the given class.This method will be called for each class in the test's class inheritance hierarchy.
- Specified by:
getConfigFor
in interfaceConfigurer<GetInstallerPackageNameMode.Mode>
- Returns:
- a configuration object, or null if the given class has no relevant data for this configuration
-
getConfigFor
Description copied from interface:Configurer
Returns the configuration for the given method.- Specified by:
getConfigFor
in interfaceConfigurer<GetInstallerPackageNameMode.Mode>
- Returns:
- a configuration object, or null if the given method has no relevant data for this configuration
-
merge
@Nonnull public GetInstallerPackageNameMode.Mode merge(@Nonnull GetInstallerPackageNameMode.Mode parentConfig, @Nonnull GetInstallerPackageNameMode.Mode childConfig)Description copied from interface:Configurer
Merges two configurations. This method will called wheneverConfigurer.getConfigFor(java.lang.String)
returns a non-null configuration object.- Specified by:
merge
in interfaceConfigurer<GetInstallerPackageNameMode.Mode>
- Parameters:
parentConfig
- a less specific configuration objectchildConfig
- a more specific configuration object- Returns:
- the new configuration with merged parent and child data.
-