Package org.robolectric.versioning
Class AndroidVersions.AndroidRelease
java.lang.Object
org.robolectric.versioning.AndroidVersions.AndroidRelease
- All Implemented Interfaces:
Comparable<AndroidVersions.AndroidRelease>
- Direct Known Subclasses:
AndroidVersions.AndroidReleased
,AndroidVersions.AndroidUnreleased
- Enclosing class:
- AndroidVersions
public abstract static class AndroidVersions.AndroidRelease
extends Object
implements Comparable<AndroidVersions.AndroidRelease>
Representation of an android release, one that has occurred, or is expected.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Implements comparable.abstract int
true if this release has already occurred, false otherwise.abstract String
single character short code for the release, multiple characters for minor releases (only minor version numbers increment - usually within the same year).abstract String
major.minor version number as String.abstract boolean
true if this release has already occurred, false otherwise.toString()
-
Constructor Details
-
AndroidRelease
public AndroidRelease()
-
-
Method Details
-
getSdkInt
public abstract int getSdkInt()true if this release has already occurred, false otherwise. If unreleased, the getSdkInt may still be that of the prior release. -
getShortCode
single character short code for the release, multiple characters for minor releases (only minor version numbers increment - usually within the same year). -
isReleased
public abstract boolean isReleased()true if this release has already occurred, false otherwise. If unreleased, the getSdkInt will guess at the likely sdk number. Your code will need to recompile if this value changes - including most modern build tools; bazle, soong all are full build systems - and as such organizations using them have no concerns. -
getVersion
major.minor version number as String. -
compareTo
Implements comparable.- Specified by:
compareTo
in interfaceComparable<AndroidVersions.AndroidRelease>
- Parameters:
other
- the object to be compared.- Returns:
- 1 if this is greater than other, 0 if equal, -1 if less
- Throws:
IllegalStateException
- if other is not an instance of AndroidRelease.
-
toString
-