org.crsh.plugin
Class PropertyManager
java.lang.Object
org.crsh.plugin.PropertyManager
-
class PropertyManager
- extends Object
-
- Author:
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final Logger log
-
.
properties
private final Map<String,Property<?>> properties
-
.
PropertyManager
PropertyManager()
getProperty
public <T> T getProperty(PropertyDescriptor<T> desc)
throws NullPointerException
-
Returns a context property or null if it cannot be found.
-
- Type Parameters:
T
- the property parameter type
- Parameters:
desc
- the property descriptor
- Returns:
- the property value
- Throws:
NullPointerException
- if the descriptor argument is null
getProperty
<T> T getProperty(String propertyName,
Class<T> type)
throws NullPointerException
-
Returns a context property or null if it cannot be found.
-
- Type Parameters:
T
- the property parameter type
- Parameters:
propertyName
- the name of the property
type
- the property type
- Returns:
- the property value
- Throws:
NullPointerException
- if the descriptor argument is null
setProperty
<T> void setProperty(PropertyDescriptor<T> desc,
T value)
throws NullPointerException
-
Set a context property to a new value. If the provided value is null, then the property is removed.
-
- Type Parameters:
T
- the property parameter type
- Parameters:
desc
- the property descriptor
value
- the property value
- Throws:
NullPointerException
- if the descriptor argument is null
setProperty
<T> void setProperty(PropertyDescriptor<T> desc,
String value)
throws NullPointerException,
IllegalArgumentException
-
Set a context property to a new value. If the provided value is null, then the property is removed.
-
- Type Parameters:
T
- the property parameter type
- Parameters:
desc
- the property descriptor
value
- the property value
- Throws:
NullPointerException
- if the descriptor argument is null
IllegalArgumentException
- if the string value cannot be converted to the property type
Copyright © 2014 eXo Platform SAS. All Rights Reserved.