danger.app
Class ComponentVersion

java.lang.Object
  extended by danger.app.ComponentVersion


public class ComponentVersion
extends Object


Field Summary
static int FLAG_DEVELOPER
           
static int FLAG_STICKY
           
static int FLAG_TINA
           
 int mBuildNumber
           
 String mName
           
 String mOrigin
           
 int mPubFlags
           
 int mPubMajor
           
 int mPubMinor
           
 int mPubPartner
           
 int mReqFlags
           
 int mReqMajor
           
 int mReqMinor
           
 int mReqPartner
           
 int mTimestamp
           
 
Constructor Summary
ComponentVersion(String name)
           
 
Method Summary
 String getDescription()
           
 String getTimeStamp()
           
 String getVersionString(boolean detailed)
          Generate a human-readable string describing this version.
 boolean satisfies(ComponentVersion child)
          Checks to see if this component publishes an API compatible with the API required by <child>.
 void set(ComponentVersion cv)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mPubFlags

public int mPubFlags

mPubPartner

public int mPubPartner

mPubMajor

public int mPubMajor

mPubMinor

public int mPubMinor

mReqFlags

public int mReqFlags

mReqPartner

public int mReqPartner

mReqMajor

public int mReqMajor

mReqMinor

public int mReqMinor

mTimestamp

public int mTimestamp

mBuildNumber

public int mBuildNumber

mName

public String mName

mOrigin

public String mOrigin

FLAG_DEVELOPER

public static final int FLAG_DEVELOPER
See Also:
Constant Field Values

FLAG_STICKY

public static final int FLAG_STICKY
See Also:
Constant Field Values

FLAG_TINA

public static final int FLAG_TINA
See Also:
Constant Field Values
Constructor Detail

ComponentVersion

public ComponentVersion(String name)
Method Detail

satisfies

public boolean satisfies(ComponentVersion child)
Checks to see if this component publishes an API compatible with the API required by <child>.

Parameters:
child - the component whose "required" field we're checking.
Returns:
true if this component is compatible with <child>.

getTimeStamp

public String getTimeStamp()

getDescription

public String getDescription()

set

public void set(ComponentVersion cv)

getVersionString

public String getVersionString(boolean detailed)
Generate a human-readable string describing this version. The version format is:
"v" + [ hardware-version + ":" ] + major-version + "." + minor-version + [ "/" + build-version ] [ + optional flags ]

The hardware version is omitted if it's zero. Similarly, the build version is also omitted if it's zero. If this is a developer build, the letter "D" is appended.

An example is "v1.2/43901", for a component with no hardware version, major version 1, minor version 2, and build version 43901.

Parameters:
detailed - true or false, whether to append package flags to the string; currently the only extra flags are "S" (sticky) and "-tina" (a radio-specific flag)
Returns:
a String describing the version

toString

public String toString()
Overrides:
toString in class Object