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 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

      public abstract String 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

      public abstract String getVersion()
      major.minor version number as String.
    • compareTo

      public int compareTo(AndroidVersions.AndroidRelease other)
      Implements comparable.
      Specified by:
      compareTo in interface Comparable<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

      public String toString()
      Overrides:
      toString in class Object