Class DataKey<T>

  • Type Parameters:
    T - The type of the object which is stored

    public abstract class DataKey<T>
    extends Object
    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)