de.agilecoders.wicket.jquery
Class Key<T>

java.lang.Object
  extended by de.agilecoders.wicket.jquery.Key<T>
All Implemented Interfaces:
IKey<T>

public class Key<T>
extends Object
implements IKey<T>

Default IKey implementation

Author:
Michael Haitz

Constructor Summary
Key(String name)
          Construct.
Key(String name, T defaultValue)
          Construct.
 
Method Summary
 T getDefaultValue()
           
 boolean isDefaultValue(T value)
          checks if given value is equal to default value
 String key()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Key

public Key(String name,
           T defaultValue)
Construct.

Parameters:
name - string representation of this key
defaultValue - The default value

Key

public Key(String name)
Construct. Uses `null` as default value

Parameters:
name - string representation of this key
Method Detail

key

public String key()
Specified by:
key in interface IKey<T>
Returns:
the key to use in Map

isDefaultValue

public boolean isDefaultValue(T value)
Description copied from interface: IKey
checks if given value is equal to default value

Specified by:
isDefaultValue in interface IKey<T>
Parameters:
value - The value to check.
Returns:
true, if given value is equal to default value

getDefaultValue

public T getDefaultValue()
Specified by:
getDefaultValue in interface IKey<T>
Returns:
the default value


Copyright © 2017. All Rights Reserved.