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 Details

  • Method Details

    • getId

      public int getId()
      Description copied from interface: DbPojo
      Get the surrogate or natural primary key id for the lookup
      Specified by:
      getId in interface DbPojo
      Returns:
      the id
    • setId

      public void setId​(int id)
      Description copied from interface: DbPojo
      Set the surrogate or natural primary key id for the lookup
      Specified by:
      setId in interface DbPojo
      Parameters:
      id - the id
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • __set

      protected void __set​(NaturalIdPojo o)
      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 class java.lang.Object
      Returns:
      a java hash code to uniquely identify and match this pojo with other pojos representing the same DB record