com.android.sdklib.repository
Class NoPreviewRevision

java.lang.Object
  extended by com.android.sdklib.repository.FullRevision
      extended by com.android.sdklib.repository.NoPreviewRevision
All Implemented Interfaces:
java.lang.Comparable<FullRevision>

public class NoPreviewRevision
extends FullRevision

Package multi-part revision number composed of a tuple (major.minor.micro) but without support for any optional preview number.

See Also:
FullRevision

Nested Class Summary
 
Nested classes/interfaces inherited from class com.android.sdklib.repository.FullRevision
FullRevision.PreviewComparison, FullRevision.PreviewType
 
Field Summary
 
Fields inherited from class com.android.sdklib.repository.FullRevision
DEFAULT_SEPARATOR, IMPLICIT_MICRO_REV, IMPLICIT_MINOR_REV, MISSING_MAJOR_REV, NOT_A_PREVIEW, NOT_SPECIFIED, PRECISION_MAJOR, PRECISION_MICRO, PRECISION_MINOR, PRECISION_PREVIEW
 
Constructor Summary
NoPreviewRevision(int major)
           
NoPreviewRevision(int major, int minor, int micro)
           
 
Method Summary
static NoPreviewRevision parseRevision(java.lang.String revision)
          Parses a string of format "major.minor.micro" and returns a new NoPreviewRevision for it.
 
Methods inherited from class com.android.sdklib.repository.FullRevision
compareTo, compareTo, equals, getMajor, getMicro, getMinor, getPreview, getSeparator, hashCode, isPreview, parseRevisionImpl, toIntArray, toShortString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoPreviewRevision

public NoPreviewRevision(int major)

NoPreviewRevision

public NoPreviewRevision(int major,
                         int minor,
                         int micro)
Method Detail

parseRevision

@NonNull
public static NoPreviewRevision parseRevision(@NonNull
                                                      java.lang.String revision)
                                       throws java.lang.NumberFormatException
Parses a string of format "major.minor.micro" and returns a new NoPreviewRevision for it. All the fields except major are optional.

The parsing is equivalent to the pseudo-BNF/regexp:

   Major/Minor/Micro/Preview := [0-9]+
   Revision := Major ('.' Minor ('.' Micro)? )? \s*
 

Parameters:
revision - A non-null revision to parse.
Returns:
A new non-null NoPreviewRevision.
Throws:
java.lang.NumberFormatException - if the parsing failed.