Revision

public abstract class Revision extends Object implements Comparable

Data class for firmware revisions.

Constructors

Name Description
public Revision()

Methods

create

public static Revision create(int major, int minor, int patch)

Creates a new instance of Revision.

Parameters

Name Description
int major
int minor
int patch

ReturnValue

Name Description
Revision

major

public abstract int major()

The major part of the revision.

ReturnValue

Name Description
int

minor

public abstract int minor()

The minor part of the revision.

ReturnValue

Name Description
int

micro

public abstract int micro()

The patch part of the revision.

ReturnValue

Name Description
int

compareTo

public int compareTo(Revision revision)

Parameters

Name Description
Revision revision

ReturnValue

Name Description
int

toString

public final String toString()

ReturnValue

Name Description
String

toZeroString

public String toZeroString()

Returns a "%03d%03d%03d" formatted representation of the version number.

ReturnValue

Name Description
String

fromZeroString

public static Revision fromZeroString(String zeroPadded)

Parse a zero-padded version string into a Revision

Parameters

Name Description
String zeroPadded

input "%03d%03d%03d" string

ReturnValue

Name Description
Revision

a Revision from the input string

typeAdapter

public static typeAdapter(Gson gson)

Parameters

Name Description
Gson gson

ReturnValue

Name Description