Package com.github.javaparser.ast
Class DataKey<T>
java.lang.Object
com.github.javaparser.ast.DataKey<T>
- Type Parameters:
T
- The type of the object which is stored
A key to a piece of data associated with a
Node
at runtime.
The key contains type information that can be used to check the
type of any user data value for the key when the value is set. DataKey is abstract in order to
force the creation of a subtype. That subtype is used to test for identity when looking for the
user data because actual object identity would suffer from problems under serialization.
So, the correct way to declare a DataKey is like this:
public static final DataKey<Role> ROLE = new DataKey<Role>() { };
This code was taken from the Wicket project.
- See Also:
Node.getData(DataKey)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DataKey
public DataKey()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-