public class DefaultSdkProvider.DefaultSdk extends Sdk
Represents an Android SDK stored at Maven Central.
Constructor and Description |
---|
DefaultSdk(int apiLevel,
String androidVersion,
String robolectricVersion,
String codeName,
int requiredJavaVersion) |
Modifier and Type | Method and Description |
---|---|
String |
getAndroidCodeName()
Returns the Android codename for this SDK.
|
String |
getAndroidVersion()
Returns the Android Version for this SDK.
|
Path |
getJarPath()
Returns the path to jar for this SDK.
|
String |
getUnsupportedMessage()
Returns a human-readable message explaining why this SDK isn’t supported.
|
boolean |
isSupported()
Determines if this SDK is supported in the running Robolectric environment.
|
public String getAndroidVersion()
Sdk
Returns the Android Version for this SDK.
It should match the version reported by android.os.Build.VERSION.RELEASE
provided within.
If this is an expensive operation, the implementation should cache the return value.
getAndroidVersion
in class Sdk
public String getAndroidCodeName()
Sdk
Returns the Android codename for this SDK.
It should match the version reported by android.os.Build.VERSION.CODENAME
provided within.
If this is an expensive operation, the implementation should cache the return value.
getAndroidCodeName
in class Sdk
public Path getJarPath()
Sdk
Returns the path to jar for this SDK.
getJarPath
in class Sdk
public boolean isSupported()
Sdk
Determines if this SDK is supported in the running Robolectric environment.
An SDK might be unsupported if e.g. it requires a newer version of the JVM than is currently running.
Unsupported SDKs should throw some explanatory exception when Sdk.getJarPath()
is invoked.
If this is an expensive operation, the implementation should cache the return value.
isSupported
in class Sdk
public String getUnsupportedMessage()
Sdk
Returns a human-readable message explaining why this SDK isn’t supported.
If this is an expensive operation, the implementation should cache the return value.
getUnsupportedMessage
in class Sdk