Package com.codingchili.core.testing
Class StorageObject
java.lang.Object
com.codingchili.core.testing.StorageObject
- All Implemented Interfaces:
Storable
,io.vertx.core.shareddata.Shareable
,Serializable
,Cloneable
,Comparable
Test class to simulate a stored object.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareToAttribute(Storable other, String attribute)
compares this storable to another storable, with an attribute specified.boolean
getId()
Get the id of the storable item, used as a key to the map api.getLevel()
getName()
int
hashCode()
void
setKeywords(List<String> keywords)
void
setNested(NestedObject nested)
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.vertx.core.shareddata.Shareable
copy
-
Field Details
-
NESTED_PREFIX
- See Also:
- Constant Field Values
-
levelField
-
name
-
level
-
nested
-
keywords
-
-
Constructor Details
-
StorageObject
public StorageObject() -
StorageObject
-
-
Method Details
-
getLevel
-
setLevel
-
getId
Description copied from interface:Storable
Get the id of the storable item, used as a key to the map api. This field is not included when serializing to JSON. When serializing to json the id must be kept separately.instead of implementing this method, to avoid duplicate values in values as keys; implement hashCode based on an unique attribute combination.
-
getName
-
setName
-
getNested
-
setNested
-
getKeywords
-
setKeywords
-
toString
-
hashCode
public int hashCode() -
equals
-
compareToAttribute
Description copied from interface:Storable
compares this storable to another storable, with an attribute specified. this method must be implemented by the storable to allow ordering. Only required for storages utilizing comparators for ordering. The implementation may be based on attribute names mapped to getter lambdas, or a simple switch.Only required when ordering by attribute with
HazelMap
- Specified by:
compareToAttribute
in interfaceStorable
- Parameters:
other
- the other object to compare to.attribute
- handler of the attribute that should be tested.- Returns:
- integer that matches implementation of @see Comparable#compareTo(Object)
-