Class AbstractUniquePojo<ID extends java.io.Serializable>
- java.lang.Object
-
- org.drdeesw.commons.models.base.pojos.AbstractUniquePojo<ID>
-
- All Implemented Interfaces:
java.io.Serializable,DataTransferObject,UniquePojo<ID>,UniqueObject<ID>
- Direct Known Subclasses:
AbstractLongUniquePojo,AbstractNamedUniquePojo,AbstractStringUniquePojo
public abstract class AbstractUniquePojo<ID extends java.io.Serializable> extends java.lang.Object implements UniquePojo<ID>
Represents a unique object.- Author:
- gary_kephart
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractUniquePojo()The default constructor.protectedAbstractUniquePojo(ID id)Constructs an object with the given id.protectedAbstractUniquePojo(UniquePojo<ID> that)Constructs a copy of the given object.AbstractUniquePojo(UniqueObject<ID> that)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends AbstractUniquePojo<ID>>
Tcast()booleanequals(java.lang.Object obj)booleanequalsWithNullCheck(java.lang.Object value1, java.lang.Object value2)IDgetId()Returns the ID of the object.inthashCode()voidsetId(ID id)java.lang.StringtoString()voidupdate(AbstractUniquePojo<ID> that)
-
-
-
Constructor Detail
-
AbstractUniquePojo
protected AbstractUniquePojo()
The default constructor.
-
AbstractUniquePojo
protected AbstractUniquePojo(ID id)
Constructs an object with the given id.- Parameters:
id- the ID of the object to construct
-
AbstractUniquePojo
protected AbstractUniquePojo(UniquePojo<ID> that)
Constructs a copy of the given object.- Parameters:
that- the object to copy
-
AbstractUniquePojo
public AbstractUniquePojo(UniqueObject<ID> that)
- Parameters:
that-
-
-
Method Detail
-
cast
protected <T extends AbstractUniquePojo<ID>> T cast()
- Returns:
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
equalsWithNullCheck
public boolean equalsWithNullCheck(java.lang.Object value1, java.lang.Object value2)- Parameters:
value1-value2-- Returns:
-
getId
public ID getId()
Returns the ID of the object.- Specified by:
getIdin interfaceUniqueObject<ID extends java.io.Serializable>- Returns:
- the unique id of the object.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setId
public void setId(ID id)
- Specified by:
setIdin interfaceUniqueObject<ID extends java.io.Serializable>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
update
public void update(AbstractUniquePojo<ID> that)
- Parameters:
that-
-
-