com.karmasphere.share.persist
Class Identity

java.lang.Object
  extended by com.karmasphere.share.persist.Persistent
      extended by com.karmasphere.share.persist.Identity
All Implemented Interfaces:
IdentityType.Discriminated, Comparable<Identity>

public final class Identity
extends Persistent
implements Comparable<Identity>, IdentityType.Discriminated

A 'holder' class for identity data, used for transformation and hashing.


Field Summary
static int INVALID_MASK
          A marker value for an invalid mask.
 
Constructor Summary
Identity(IdentityType type, byte[] data, int mask)
           
Identity(int idtype, byte[] data, int mask)
           
 
Method Summary
 int compareTo(Identity i)
           
 boolean equals(Object o)
           
 byte[] getData()
          Returns the identity data.
 String getDataString()
           
 IdentityType getIdentityType()
           
 int getIdentityTypeId()
           
 int getMask()
           
 int hashCode()
           
 void setData(byte[] data)
           
 void setIdentityType(IdentityType type)
           
 void setIdentityTypeId(int idtype)
           
 void setMask(int mask)
           
 String toString()
          Returns a simple String representation of this Persistent.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID_MASK

public static final int INVALID_MASK
A marker value for an invalid mask.

See Also:
Constant Field Values
Constructor Detail

Identity

public Identity(IdentityType type,
                byte[] data,
                int mask)

Identity

public Identity(int idtype,
                byte[] data,
                int mask)
Method Detail

setIdentityType

public void setIdentityType(IdentityType type)

getIdentityType

public IdentityType getIdentityType()
Specified by:
getIdentityType in interface IdentityType.Discriminated

setIdentityTypeId

public void setIdentityTypeId(int idtype)

getIdentityTypeId

public int getIdentityTypeId()

setData

public void setData(byte[] data)

getData

public byte[] getData()
Returns the identity data. The internal array is returned. Do not modify it.


getDataString

public String getDataString()

setMask

public void setMask(int mask)

getMask

public int getMask()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Identity i)
Specified by:
compareTo in interface Comparable<Identity>

toString

public String toString()
Description copied from class: Persistent
Returns a simple String representation of this Persistent.

Overrides:
toString in class Persistent


Copyright © 2004-2005 Karamsphere. All Rights Reserved.