Package org.datanucleus.identity
Class ShortId
- java.lang.Object
-
- org.datanucleus.identity.SingleFieldId<java.lang.Short,ShortId>
-
- org.datanucleus.identity.ShortId
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Comparable<ShortId>
public class ShortId extends SingleFieldId<java.lang.Short,ShortId>
This class is for identity with a single short field.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private short
key
-
Fields inherited from class org.datanucleus.identity.SingleFieldId
hashCode, STRING_DELIMITER, targetClassName
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ShortId other)
short
getKey()
java.lang.Short
getKeyAsObject()
Accessor for the keyprotected boolean
keyEquals(ShortId obj)
void
readExternal(java.io.ObjectInput in)
Read this object.java.lang.String
toString()
Return the String form of the key.void
writeExternal(java.io.ObjectOutput out)
Write this object.-
Methods inherited from class org.datanucleus.identity.SingleFieldId
assertKeyNotNull, compare, equals, getTargetClassName, hashCode
-
-
-
-
Method Detail
-
getKey
public short getKey()
-
getKeyAsObject
public java.lang.Short getKeyAsObject()
Description copied from class:SingleFieldId
Accessor for the key- Specified by:
getKeyAsObject
in classSingleFieldId<java.lang.Short,ShortId>
- Returns:
- The key
-
toString
public java.lang.String toString()
Return the String form of the key.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the String form of the key
-
keyEquals
protected boolean keyEquals(ShortId obj)
- Specified by:
keyEquals
in classSingleFieldId<java.lang.Short,ShortId>
-
compareTo
public int compareTo(ShortId other)
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Write this object. Write the superclass first.- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classSingleFieldId<java.lang.Short,ShortId>
- Parameters:
out
- the output- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Read this object. Read the superclass first.- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classSingleFieldId<java.lang.Short,ShortId>
- Parameters:
in
- the input- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-