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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareToAttribute(Storable other, String attribute)compares this storable to another storable, with an attribute specified.booleangetId()Get the id of the storable item, used as a key to the map api.getLevel()getName()inthashCode()voidsetKeywords(List<String> keywords)voidsetNested(NestedObject nested)toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:StorableGet 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:Storablecompares 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:
compareToAttributein 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)
-