Represents an inmate in our "jail". If someone does something we don't like, they do their time here.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(String serializedText) Deserialize the string into a strongly-typed object.booleanlonggetIndex()Each piece of data is made unique by having its own index valueinthashCode()Serializes this object into a string representation.voidsetIndex(long index) toString()
-
Field Details
-
EMPTY
Builds an empty version of this class, except that it has a current Context object
-
-
Constructor Details
-
Inmate
Represents an inmate in our "jail". If someone does something we don't like, they do their time here.- Parameters:
clientId- a string representation of the client address plus a string representing the offense, for example, "1.2.3.4_vuln_seeking" - 1.2.3.4 was seeking out vulnerabilities.releaseTime- the time, in milliseconds from the epoch, at which this inmate will be released from the brig.
-
-
Method Details
-
getIndex
public long getIndex()Description copied from class:DbDataEach piece of data is made unique by having its own index value -
setIndex
public void setIndex(long index) -
serialize
Description copied from class:DbDataSerializes this object into a string representation.An example:
public String serialize() { return serializeHelper(index, a, b); }- Specified by:
serializein classDbData<Inmate>- Returns:
- this type serialized to a string - use
SerializationUtils.serializeHelper(Object[]) - See Also:
-
deserialize
Description copied from class:DbDataDeserialize the string into a strongly-typed object. See helper methodSerializationUtils.deserializeHelper(String)to split a serialized string into tokens for rebuilding the object. See alsoDbData.serialize()An example:
public Foo deserialize(String serializedText) { final var tokens = deserializeHelper(serializedText); return new Foo( Integer.parseInt(tokens.get(0)), Integer.parseInt(tokens.get(1)), tokens.get(2) ); }- Specified by:
deserializein classDbData<Inmate>- Parameters:
serializedText- the serialized string- Returns:
- this type deserialized from a string
- See Also:
-
getClientId
-
getReleaseTime
-
equals
-
hashCode
public int hashCode() -
toString
-