Package tenapull.data.entity.template
Class NaturalIdPojo
java.lang.Object
tenapull.data.entity.template.ExtensibleJsonPojo
tenapull.data.entity.template.NaturalIdPojo
- All Implemented Interfaces:
DbPojo
- Direct Known Subclasses:
Folder
,NessusResponse.SingleChildTemplate
,NessusResponseGenerateTimestamp
,Scan
@MappedSuperclass public abstract class NaturalIdPojo extends ExtensibleJsonPojo implements DbPojo
Represents POJOs with extensible JSON and a natural primary key id provided by the Nessus API
-
Constructor Summary
Constructors Constructor Description NaturalIdPojo()
-
Method Summary
Modifier and Type Method Description protected void
__set(NaturalIdPojo o)
Convenience method for any subclasses which wish to implement one of the lookup interfaces (MapLookup or HashLookup).boolean
equals(java.lang.Object o)
int
getId()
Get the surrogate or natural primary key id for the lookupint
hashCode()
Default implementation of the java hashCode() method used by HashMap and HashSet.void
setId(int id)
Set the surrogate or natural primary key id for the lookupMethods inherited from class tenapull.data.entity.template.ExtensibleJsonPojo
__prepare, getExtraJson, getExtraJson, getExtraJsonMap, putExtraJson, setExtraJson, toJsonNode, toJsonString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface tenapull.data.entity.template.DbPojo
_prepare, toJsonNode, toJsonString
-
Constructor Details
-
NaturalIdPojo
public NaturalIdPojo()
-
-
Method Details
-
getId
public int getId()Description copied from interface:DbPojo
Get the surrogate or natural primary key id for the lookup -
setId
public void setId(int id)Description copied from interface:DbPojo
Set the surrogate or natural primary key id for the lookup -
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
__set
Convenience method for any subclasses which wish to implement one of the lookup interfaces (MapLookup or HashLookup). This can be invoked to synchronize the ExtraJson between two pojos representing the same DB record. Unlike the NaturalIdPojo, __set here does NOT set the id, because it is a surrogate key and not a natural part of the Nessus API response- Parameters:
o
- the other pojo which also represents the same DB record, to synchronize this pojo's extraJson with
-
hashCode
public int hashCode()Default implementation of the java hashCode() method used by HashMap and HashSet. Performs a bitwise XOR on the hashCode of the implementing type's .class object, and the id of the pojo.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a java hash code to uniquely identify and match this pojo with other pojos representing the same DB record
-