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).booleanequals(java.lang.Object o)intgetId()Get the surrogate or natural primary key id for the lookupinthashCode()Default implementation of the java hashCode() method used by HashMap and HashSet.voidsetId(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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:DbPojoGet the surrogate or natural primary key id for the lookup -
setId
public void setId(int id)Description copied from interface:DbPojoSet the surrogate or natural primary key id for the lookup -
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin 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:
hashCodein classjava.lang.Object- Returns:
- a java hash code to uniquely identify and match this pojo with other pojos representing the same DB record
-