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.J
,AndroidVersions.JMR1
,AndroidVersions.JMR2
,AndroidVersions.K
,AndroidVersions.L
,AndroidVersions.LMR1
,AndroidVersions.M
,AndroidVersions.N
,AndroidVersions.NMR1
,AndroidVersions.O
,AndroidVersions.OMR1
,AndroidVersions.P
,AndroidVersions.Q
,AndroidVersions.R
,AndroidVersions.S
,AndroidVersions.Sv2
,AndroidVersions.T
,AndroidVersions.U
,AndroidVersions.V
- 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.int
true if this release has already occurred, false otherwise.single character short code for the release, multiple characters for minor releases (only minor version numbers increment - usually within the same year).major.minor version number as String.boolean
true if this release has already occurred, false otherwise.toString()
-
Constructor Details
-
AndroidRelease
public AndroidRelease()
-
-
Method Details
-
getSdkInt
public 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 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:
RuntimeException
- if other is not an instance of AndroidRelease.
-
toString
-