T - data classpublic final class Key<T> extends java.lang.Object implements java.lang.Comparable<Key<?>>, java.io.Serializable
DataNode objects where every DataNode content type is identified by an instance of this class.
That makes it possible to register custom DataNode processor per-Key
Thread-safe.| Constructor and Description |
|---|
Key(java.lang.String dataClass,
int processingWeight)
Creates new
Key object. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Key<?> that) |
static <T> Key<T> |
create(java.lang.Class<T> dataClass,
int processingWeight) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getDataType() |
int |
getProcessingWeight()
|
int |
hashCode() |
java.lang.String |
toString() |
public Key(java.lang.String dataClass,
int processingWeight)
Key object.dataClass - class of the payload data which will be associated with the current keyprocessingWeight - there is a possible case that when a DataNode object has children of more than on type (children
with more than one different Key we might want to process one type of children before another.
That's why we need a way to define that processing order. This parameter serves exactly for that -
lower value means that key's payload should be processed before payload of the key with a greater
valuepublic static <T> Key<T> create(java.lang.Class<T> dataClass, int processingWeight)
public java.lang.String getDataType()
public int getProcessingWeight()
DataNode object has children of more than on type (children with more than
one different Key we might want to process one type of children before another. That's why we need a way to define
that processing order. This property serves exactly for that - lower value means that key's payload should be processed
before payload of the key with a greater value.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(Key<?> that)
compareTo in interface java.lang.Comparable<Key<?>>public java.lang.String toString()
toString in class java.lang.Object