com.metamatrix.platform.security.api
Class MetaMatrixSessionID

java.lang.Object
  extended by com.metamatrix.platform.security.api.MetaMatrixSessionID
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MetaMatrixSessionID>

public final class MetaMatrixSessionID
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<MetaMatrixSessionID>

This immutable class represents an identifier for a unique MetaMatrix session within a given MetaMatrix System. This object will be returned to the Client when login to the MetaMatrix Server

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
MetaMatrixSessionID()
           
MetaMatrixSessionID(long id)
          Used to create a deterministic id, mostly called by tests
MetaMatrixSessionID(java.lang.String id)
          Converts the given string into a session id.
 
Method Summary
 int compareTo(MetaMatrixSessionID obj)
          Compares this object to another.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is semantically equal to this instance.
 int hashCode()
          Returns the hash code value for this object.
 java.lang.String toString()
          Returns a string representing the current state of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

MetaMatrixSessionID

public MetaMatrixSessionID(long id)
Used to create a deterministic id, mostly called by tests


MetaMatrixSessionID

public MetaMatrixSessionID()

MetaMatrixSessionID

public MetaMatrixSessionID(java.lang.String id)
Converts the given string into a session id.

Parameters:
id -
Throws:
java.lang.IllegalArgumentException - if id is not valid
Method Detail

compareTo

public int compareTo(MetaMatrixSessionID obj)
Compares this object to another. If the specified object is an instance of the MetaMatrixSessionID class, then this method compares the contents; otherwise, it throws a ClassCastException (as instances are comparable only to instances of the same class).

Note: this method is consistent with equals(), meaning that (compare(x, y)==0) == (x.equals(y)).

Specified by:
compareTo in interface java.lang.Comparable<MetaMatrixSessionID>
Parameters:
obj - the object that this instance is to be compared to.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object, respectively.
Throws:
java.lang.NullPointerException - if the specified object reference is null
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this instance.

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with compareTo().

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object that this instance is to be compared to.
Returns:
whether the object is equal to this object.

hashCode

public final int hashCode()
Returns the hash code value for this object.

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

toString

public final java.lang.String toString()
Returns a string representing the current state of the object.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this instance.


Copyright © 2009. All Rights Reserved.