Class RepositoryObjectKey
java.lang.Object
io.higson.runtime.engine.annotated.RepositoryObjectKey
- All Implemented Interfaces:
Comparable<RepositoryObjectKey>
Complex key that can be used in maps that need only unique entries and
custom ordering at the same time.
Object consists of:
Only key is used to compute hash key and determine equality of two objects. Only order is used in comparison method from
- key - string name, that can be used to preserve uniqueness of entries
- order - integer value, that can be used for ordering
Only key is used to compute hash key and determine equality of two objects. Only order is used in comparison method from
Comparable interface.- Since:
- 0.1.0
- Author:
- Adam Dubiel
-
Constructor Summary
ConstructorsConstructorDescriptionCreate new repository key with only string key.RepositoryObjectKey(String key, int order) Create new repository key with string key and order. -
Method Summary
-
Constructor Details
-
RepositoryObjectKey
Create new repository key with only string key.- Parameters:
key- unique key
-
RepositoryObjectKey
Create new repository key with string key and order.- Parameters:
key- unique keyorder- order of item if sorted
-
-
Method Details
-
withKey
-
getKey
-
getOrder
public int getOrder() -
compareTo
- Specified by:
compareToin interfaceComparable<RepositoryObjectKey>
-
equals
-
hashCode
public int hashCode() -
toString
-