Package net.solarnetwork.dao
Class BasicIdentity<PK extends Comparable<PK>>
java.lang.Object
net.solarnetwork.dao.BasicIdentity<PK>
- All Implemented Interfaces:
Serializable,Comparable<PK>,Identity<PK>
- Direct Known Subclasses:
BasicEntity
public class BasicIdentity<PK extends Comparable<PK>>
extends Object
implements Identity<PK>, Serializable
A basic, immutable implementation of
Identity that is also
Serializable.- Since:
- 1.72
- Version:
- 1.0
- Author:
- matt
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BasicIdentity
Constructor.- Parameters:
id- the ID to use
-
-
Method Details
-
clone
-
hashCode
public int hashCode() -
equals
Test if twoBasicIdentityobjects have the samegetId()value. -
compareTo
Compare based on theid, with null values ordered before non-null values.- Specified by:
compareToin interfaceComparable<PK extends Comparable<PK>>
-
getId
Description copied from interface:IdentityGet the primary identifier of the object- Specified by:
getIdin interfaceIdentity<PK extends Comparable<PK>>- Returns:
- the primary identifier
-