danger.app
Class ComponentVersion

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


public class ComponentVersion
extends Object

ComponentVersion objects contain versioning information about applications and libraries.

You can obtain a ComponentVersion object by using Registrar.findComponentVersionByName(java.lang.String) or Registrar.getComponentVersionList().

Most of the information here is displayed in the System Info screen.


Field Summary
static int FLAG_DEVELOPER
          Possible value for mPubFlags.
static int FLAG_STICKY
          Possible value for mPubFlags.
static int FLAG_TINA
          Possible value for mPubFlags.
 int mBuildNumber
          Build number of the component.
 String mName
          Name of the component.
 String mOrigin
          Where this component build originated from.
 int mPubFlags
          Flags for this component.
 int mPubMajor
          Major version for this component.
 int mPubMinor
          Minor version for this component.
 int mPubPartner
          Partner ID for this component.
 int mReqFlags
          Required flags for this component.
 int mReqMajor
          Required major version for this component.
 int mReqMinor
          Required minor version for this component.
 int mReqPartner
          Required partner ID for this component.
 int mTimestamp
          Time the component was built, in Danger GMT time (seconds since January 1, 2000).
 
Constructor Summary
ComponentVersion(String name)
          Construct a ComponentVersion with the specified name.
 
Method Summary
 String getDescription()
          Get the description for the component.
 String getTimeStamp()
          Get the time that the component was built.
 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)
          Set this ComponentVersion to be equivalent to the specified ComponentVersion.
 String toString()
          Get a string including the name, description, mPubPartner, mPubMajor, mPubMinor, mPubFlags, mReqPartner, mReqMajor, mReqMinor, and mReqFlags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mPubFlags

public int mPubFlags
Flags for this component. Can be any of the following: FLAG_DEVELOPER, FLAG_STICKY, FLAG_TINA.


mPubPartner

public int mPubPartner
Partner ID for this component.


mPubMajor

public int mPubMajor
Major version for this component.


mPubMinor

public int mPubMinor
Minor version for this component.


mReqFlags

public int mReqFlags
Required flags for this component. Can be any of the following: FLAG_DEVELOPER, FLAG_STICKY, FLAG_TINA. This is not used in satisfies(danger.app.ComponentVersion).


mReqPartner

public int mReqPartner
Required partner ID for this component. This is used in satisfies(danger.app.ComponentVersion).


mReqMajor

public int mReqMajor
Required major version for this component. This is used in satisfies(danger.app.ComponentVersion).


mReqMinor

public int mReqMinor
Required minor version for this component. This is used in satisfies(danger.app.ComponentVersion).


mTimestamp

public int mTimestamp
Time the component was built, in Danger GMT time (seconds since January 1, 2000).


mBuildNumber

public int mBuildNumber
Build number of the component.


mName

public String mName
Name of the component.


mOrigin

public String mOrigin
Where this component build originated from.


FLAG_DEVELOPER

public static final int FLAG_DEVELOPER
Possible value for mPubFlags.

See Also:
Constant Field Values

FLAG_STICKY

public static final int FLAG_STICKY
Possible value for mPubFlags.

See Also:
Constant Field Values

FLAG_TINA

public static final int FLAG_TINA
Possible value for mPubFlags.

See Also:
Constant Field Values
Constructor Detail

ComponentVersion

public ComponentVersion(String name)
Construct a ComponentVersion with the specified 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()
Get the time that the component was built.


getDescription

public String getDescription()
Get the description for the component.


set

public void set(ComponentVersion cv)
Set this ComponentVersion to be equivalent to the specified ComponentVersion.


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()
Get a string including the name, description, mPubPartner, mPubMajor, mPubMinor, mPubFlags, mReqPartner, mReqMajor, mReqMinor, and mReqFlags.

Overrides:
toString in class Object