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.
Node#getData(DataKey)
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public int |
| DataKey | back to summary |
|---|---|
| public DataKey() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |