com.versionone
Class Oid

java.lang.Object
  extended by com.versionone.Oid

public class Oid
extends java.lang.Object

VersionOne object identifier


Field Summary
static Oid Null
           
protected static java.lang.String NullOidToken
           
 
Constructor Summary
Oid(IAssetType assetType)
          Create Object Identifier with just an AssetType
Oid(IAssetType assetType, DB.Int id, DB.Int moment)
          Deprecated. use Oid(com.versionone.apiclient.IAssetType, int, int)
Oid(IAssetType assetType, int id)
          Create Object Identifier without moment
Oid(IAssetType assetType, int id, DB.Int moment)
          Deprecated. use Oid(com.versionone.apiclient.IAssetType, int)
Oid(IAssetType assetType, int id, int moment)
          Create fully qualified object identifier
 
Method Summary
static boolean compare(Oid lhs, Oid rhs)
          Compare two oids
 boolean equals(java.lang.Object obj)
          Compare this instance to another oid
static Oid fromToken(java.lang.String oidtoken, IMetaModel meta)
          Create an OID from a token
 IAssetType getAssetType()
          Get the AssetType
 java.lang.Object getKey()
          Get the id for this instance
 java.lang.Object getMoment()
          get the moment for this oid
 Oid getMomentless()
          Get this instance as a momentless oid
 java.lang.String getToken()
          Get the token for this object identifier
 int hashCode()
          Get the hash code for the oid
 boolean hasMoment()
          Does this instance contain a moment?
 boolean isNull()
          Is this OID null
 java.lang.String toString()
          Object as string (the token)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NullOidToken

protected static final java.lang.String NullOidToken
See Also:
Constant Field Values

Null

public static final Oid Null
Constructor Detail

Oid

public Oid(IAssetType assetType,
           DB.Int id,
           DB.Int moment)
Deprecated. use Oid(com.versionone.apiclient.IAssetType, int, int)

Create fully qualified object identifier

Parameters:
assetType -
id -
moment -

Oid

public Oid(IAssetType assetType,
           int id,
           DB.Int moment)
Deprecated. use Oid(com.versionone.apiclient.IAssetType, int)

Create fully qualified object identifier

Parameters:
assetType -
id -
moment -

Oid

public Oid(IAssetType assetType,
           int id,
           int moment)
Create fully qualified object identifier

Parameters:
assetType -
id -
moment -

Oid

public Oid(IAssetType assetType,
           int id)
Create Object Identifier without moment

Parameters:
assetType -
id -

Oid

public Oid(IAssetType assetType)
Create Object Identifier with just an AssetType

Parameters:
assetType -
Method Detail

getAssetType

public IAssetType getAssetType()
Get the AssetType

Returns:
IAssetType for this OID

getKey

public java.lang.Object getKey()
Get the id for this instance

Returns:
value as Integer

getMoment

public java.lang.Object getMoment()
get the moment for this oid

Returns:
value as Integer or null

isNull

public boolean isNull()
Is this OID null

Returns:
true if it's null, false otherwise

getToken

public java.lang.String getToken()
Get the token for this object identifier

Returns:
string containing token

toString

public java.lang.String toString()
Object as string (the token)

Overrides:
toString in class java.lang.Object

fromToken

public static Oid fromToken(java.lang.String oidtoken,
                            IMetaModel meta)
                     throws OidException
Create an OID from a token

Parameters:
oidtoken - - token to parse
meta - - metamodel
Returns:
an Oid
Throws:
OidException - - if the OID cannot be created.

getMomentless

public Oid getMomentless()
Get this instance as a momentless oid

Returns:
- momentless OID

hasMoment

public boolean hasMoment()
Does this instance contain a moment?

Returns:
true if a moment exists, false otherwise

equals

public boolean equals(java.lang.Object obj)
Compare this instance to another oid

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Get the hash code for the oid

Overrides:
hashCode in class java.lang.Object

compare

public static boolean compare(Oid lhs,
                              Oid rhs)
Compare two oids

Parameters:
lhs - - left hand side
rhs - - right hand side
Returns:
true if these are equal; false otherwise