public class DefaultLicenseContext extends Object implements ILicenseContext
ILicenseContext.| Constructor and Description |
|---|
DefaultLicenseContext()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(Class<T> clazz)
Returns the property of given class.
|
Object |
get(String key)
Returns the property with given key.
|
Iterable<String> |
getKeys()
Returns the property keys.
|
boolean |
hasKey(Class<?> clazz)
Returns whether the context has such a value.
|
boolean |
hasKey(String key)
Returns whether the context has such a value.
|
<T> T |
remove(Class<T> clazz)
Removes the property of given class.
|
Object |
remove(String key)
Removes the property with given key.
|
<T> void |
set(Class<T> clazz,
T value)
Sets the property.
|
void |
set(String key,
Object value)
Sets the property.
|
public Object get(String key)
get in interface ILicenseContextkey - key of propertynull if the property doesn't existpublic <T> T get(Class<T> clazz)
get in interface ILicenseContextclazz - type of propertynull if the property doesn't existpublic boolean hasKey(Class<?> clazz)
hasKey in interface ILicenseContextclazz - the clazz to look for (name is key)true when context has this keypublic boolean hasKey(String key)
hasKey in interface ILicenseContextkey - the key to look fortrue when context has this keypublic void set(String key, Object value)
set in interface ILicenseContextkey - key of propertyvalue - valuepublic <T> void set(Class<T> clazz, T value)
set in interface ILicenseContextclazz - class of propertyvalue - valuepublic Iterable<String> getKeys()
getKeys in interface ILicenseContextpublic Object remove(String key)
remove in interface ILicenseContextkey - key of propertypublic <T> T remove(Class<T> clazz)
remove in interface ILicenseContextclazz - class of propertyCopyright © 2014. All rights reserved.