com.versionone.om
Class AssetID

java.lang.Object
  extended by com.versionone.om.AssetID

public class AssetID
extends java.lang.Object

Represents a unique ID in the VersionOne system. The ToToken and FromToken methods are provided to convert an AssetID to and from a string for storage.


Constructor Summary
AssetID(java.lang.String token)
          Construct an AssetID by ID.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this AssetID with the specified object.
static AssetID fromToken(java.lang.String token)
          Create an AssetID form a tokenized ID.
 java.lang.String getToken()
           
 int hashCode()
          To calculate hashCode used token
 java.lang.String toString()
          Tokenize the ID.
static AssetID valueOf(java.lang.String idString)
          Convert a string to an AssetID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssetID

public AssetID(java.lang.String token)
Construct an AssetID by ID.

Parameters:
token - id of the Asset.
Method Detail

getToken

public java.lang.String getToken()
Returns:
String representation of the AssetID.

fromToken

public static AssetID fromToken(java.lang.String token)
Create an AssetID form a tokenized ID.

Parameters:
token - String representation of the AssetID.
Returns:
AssetID created by idString

equals

public boolean equals(java.lang.Object obj)
Compares this AssetID with the specified object. The result is true if and only if the argument is not null and is an AssetID with the same token.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare this AssetID against.
Returns:
true if the given object represents the same AssetID on the server, false otherwise.

hashCode

public int hashCode()
To calculate hashCode used token

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

toString

public java.lang.String toString()
Tokenize the ID.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the ID. The same a the Token property.

valueOf

public static AssetID valueOf(java.lang.String idString)
Convert a string to an AssetID.

Parameters:
idString - The tokenized ID.
Returns:
AssetID created by idString.