Class ExtraJson
java.lang.Object
tenapull.data.entity.objectLookup.ExtraJson
- All Implemented Interfaces:
- java.lang.Comparable<ExtraJson>,- DbPojo,- HashLookupPojo<ExtraJson>
@Entity(name="ExtraJson") public class ExtraJson extends java.lang.Object implements HashLookupPojo<ExtraJson>
Represents a reusable extra json lookup, for any unexpected json returned from the
 Nessus API
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classExtraJson.ConverterHibernate converter.static classExtraJson.JsonMapA wrapper for the map representing the key-value pairs of the ExtraJson.
- 
Field SummaryFields Modifier and Type Field Description static ExtraJson.ConverterconverterA singleton instance of the DB converter for static utility usagestatic HashLookupDao<ExtraJson>daoThe dao for ExtraJson
- 
Constructor SummaryConstructors Constructor Description ExtraJson()Instantiates a new Extra json.ExtraJson(java.lang.String jsonStr)Instantiates a new Extra json by deserializing a stringExtraJson(java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> value)Instantiates a new Extra json using a map of string keys and JsonNodes.ExtraJson(ExtraJson copyExceptId)Instantiates a new Extra json, copying the value map of the passed ExtraJson
- 
Method SummaryModifier and Type Method Description boolean_isHashCalculated()Shortcut for the StringHashLookupDao to determine what approach to most efficiently use to find a matching value for this lookup.boolean_match(ExtraJson other)Determine if this pojo represents the same DB record as another POJO of the same type.void_prepare()Perform any operations necessary to prepare this pojo for insertion or updating in the databasevoid_set(ExtraJson other)Synchronize the values of two matching POJOs which represent the same DB recordbooleanequals(java.lang.Object o)static java.lang.StringescapeString(java.lang.String str)Static utility method for creating a Json escape string of a given stringstatic java.lang.StringescapeStringNoQuotes(java.lang.String str)Static utility method for creating a Json escape string of a given string, but omitting the leading and trailing quotation marks.com.fasterxml.jackson.databind.JsonNodeget(java.lang.String key)Get the json node in the value map at the provided keyHashget_hash()Get the _hash of the "object lookup" pojo used for indexing it.intgetId()Get the surrogate or natural primary key id for the lookupExtraJson.JsonMapgetValue()Returns the value mapinthashCode()com.fasterxml.jackson.databind.JsonNodeput(java.lang.String key, com.fasterxml.jackson.databind.JsonNode value)Put the provided json node in the value map using the provided keyvoidset_hash(Hash _hash)Set the _hash of the pojo used for indexing itvoidsetId(int id)Set the surrogate or natural primary key id for the lookupvoidsetValue(ExtraJson.JsonMap map)Sets the value mapintsize()The size of the value mapcom.fasterxml.jackson.databind.node.ObjectNodetoJsonNode()Convert the pojo into a JsonNodejava.lang.StringtoJsonString()Convert the pojo into a Json stringjava.lang.StringtoString()
- 
Field Details
- 
Constructor Details- 
ExtraJsonpublic ExtraJson()Instantiates a new Extra json.
- 
ExtraJsonInstantiates a new Extra json, copying the value map of the passed ExtraJson- Parameters:
- copyExceptId- the ExtraJson to copy the value map from
 
- 
ExtraJsonpublic ExtraJson(java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> value) throws java.lang.NullPointerExceptionInstantiates a new Extra json using a map of string keys and JsonNodes.- Parameters:
- value- the map to copy
- Throws:
- java.lang.NullPointerException- if the value is null
 
- 
ExtraJsonpublic ExtraJson(java.lang.String jsonStr) throws com.fasterxml.jackson.core.JsonProcessingException, java.lang.IllegalArgumentExceptionInstantiates a new Extra json by deserializing a string- Parameters:
- jsonStr- the json str to deserialize
- Throws:
- com.fasterxml.jackson.core.JsonProcessingException- if there is a JsonProcessingException while deserialization
- java.lang.IllegalArgumentException- if the deserialized JsonNode is something other than an ObjectNode
 
 
- 
- 
Method Details- 
escapeStringpublic static java.lang.String escapeString(java.lang.String str)Static utility method for creating a Json escape string of a given string- Parameters:
- str- the string to escape
- Returns:
- the JSON-escaped string
 
- 
escapeStringNoQuotespublic static java.lang.String escapeStringNoQuotes(java.lang.String str)Static utility method for creating a Json escape string of a given string, but omitting the leading and trailing quotation marks.- Parameters:
- str- the string to escape
- Returns:
- the JSON-escaped string without enclosing quotation marks
 
- 
get_hashDescription copied from interface:HashLookupPojoGet the _hash of the "object lookup" pojo used for indexing it.- Specified by:
- get_hashin interface- HashLookupPojo<ExtraJson>
- Returns:
- the Hash of the object lookup
 
- 
set_hashDescription copied from interface:HashLookupPojoSet the _hash of the pojo used for indexing it- Specified by:
- set_hashin interface- HashLookupPojo<ExtraJson>
- Parameters:
- _hash- the hash to set
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- java.lang.Object
 
- 
equalspublic boolean equals(java.lang.Object o)- Overrides:
- equalsin class- java.lang.Object
 
- 
putpublic com.fasterxml.jackson.databind.JsonNode put(java.lang.String key, com.fasterxml.jackson.databind.JsonNode value) throws java.lang.IllegalStateExceptionPut the provided json node in the value map using the provided key- Parameters:
- key- the key
- value- the value
- Returns:
- the json node
- Throws:
- java.lang.IllegalStateException- the illegal state exception
 
- 
getpublic com.fasterxml.jackson.databind.JsonNode get(java.lang.String key)Get the json node in the value map at the provided key- Parameters:
- key- the key
- Returns:
- the json node
 
- 
toStringpublic java.lang.String toString()- Overrides:
- toStringin class- java.lang.Object
 
- 
sizepublic int size()The size of the value map- Returns:
- the int
 
- 
getIdpublic int getId()Description copied from interface:DbPojoGet the surrogate or natural primary key id for the lookup
- 
setIdpublic void setId(int id)Description copied from interface:DbPojoSet the surrogate or natural primary key id for the lookup
- 
getValueReturns the value map- Returns:
- the value
 
- 
setValueSets the value map- Parameters:
- map- the map
- Throws:
- java.lang.NullPointerException- the null pointer exception
 
- 
_isHashCalculatedpublic boolean _isHashCalculated()Description copied from interface:HashLookupPojoShortcut for the StringHashLookupDao to determine what approach to most efficiently use to find a matching value for this lookup. If the hash is already calculated, it is most efficient to use the hash. If it is not, it may be more efficient to use the _match method- Specified by:
- _isHashCalculatedin interface- HashLookupPojo<ExtraJson>
- Returns:
- true if the hash has already been calculated, false if not
 
- 
_matchDescription copied from interface:HashLookupPojoDetermine if this pojo represents the same DB record as another POJO of the same type. Note that this is NOT the same as the equals() method (though it may be in certain cases). Equals may be used to determine if two pojos of the same type contain all of the same values, regardless of whether they represent the same DB record (depending on implementation) while _match determines only if they represent the same DB record even if some of the values may not be equivalent. In many cases the two methods may be the same, but their purpose is different.- Specified by:
- _matchin interface- HashLookupPojo<ExtraJson>
- Parameters:
- other- other pojo to match
- Returns:
- true if the two pojos represent the same DB record, false if not
 
- 
toJsonNodepublic com.fasterxml.jackson.databind.node.ObjectNode toJsonNode()Description copied from interface:DbPojoConvert the pojo into a JsonNode- Specified by:
- toJsonNodein interface- DbPojo
- Returns:
- a JsonNode representing the serialization of this pojo
 
- 
toJsonStringpublic java.lang.String toJsonString() throws com.fasterxml.jackson.core.JsonProcessingExceptionDescription copied from interface:DbPojoConvert the pojo into a Json string- Specified by:
- toJsonStringin interface- DbPojo
- Returns:
- a string representing the Json serialization of this pojo
- Throws:
- com.fasterxml.jackson.core.JsonProcessingException
 
- 
_preparepublic void _prepare()Description copied from interface:DbPojoPerform any operations necessary to prepare this pojo for insertion or updating in the database
- 
_setDescription copied from interface:HashLookupPojoSynchronize the values of two matching POJOs which represent the same DB record- Specified by:
- _setin interface- HashLookupPojo<ExtraJson>
- Parameters:
- other- the other pojo representing the same DB record, which the values should be taken from
 
 
-