public abstract class Properties
extends com.google.gwt.core.client.JavaScriptObject
Modifier and Type | Class and Description |
---|---|
static class |
Properties.TypeException
An exception thrown by the get methods when the key is found but the
value has an unexpected type.
|
Modifier | Constructor and Description |
---|---|
protected |
Properties() |
Modifier and Type | Method and Description |
---|---|
static Properties |
create()
Create an empty Properties object.
|
java.lang.Boolean |
getBoolean(java.lang.String key)
Get a Boolean value mapped to the specified key.
|
java.util.Date |
getDate(java.lang.String key)
Get a Date object mapped to the specified key.
|
java.lang.Double |
getNumber(java.lang.String key)
Get a Double value mapped to the specified key.
|
com.google.gwt.core.client.JavaScriptObject |
getObject(java.lang.String key)
Get a JavaScriptObject mapped to the specified key.
|
java.lang.String |
getString(java.lang.String key)
Get a String mapped to the specified key.
|
void |
remove(java.lang.String key)
Remove the property at the specified key.
|
void |
set(java.lang.String key,
java.lang.Boolean value)
Set a property.
|
void |
set(java.lang.String key,
java.util.Date value)
Set a property.
|
void |
set(java.lang.String key,
java.lang.Double value)
Set a property.
|
void |
set(java.lang.String key,
com.google.gwt.core.client.JavaScriptObject value)
Set a property.
|
void |
set(java.lang.String key,
java.lang.String value)
Set a property.
|
java.lang.String |
typeofValue(java.lang.String key)
Executes the JavaScript typeof operator against the property with the
given key.
|
public static Properties create()
public final java.lang.Boolean getBoolean(java.lang.String key) throws Properties.TypeException
key
- The name of the Boolean property.Properties.TypeException
- if the key is found but the object returned
is not a Boolean.public final java.util.Date getDate(java.lang.String key) throws com.google.gwt.core.client.JavaScriptException, Properties.TypeException
key
- The name of the Date property.com.google.gwt.core.client.JavaScriptException
- if the key is found but the object returned
is not a Date.Properties.TypeException
- If the key is found but the value is not an object.public final java.lang.Double getNumber(java.lang.String key) throws Properties.TypeException
key
- The name of the Double property.Properties.TypeException
- If the key is found but the value is not a
number (integers are fine).public final com.google.gwt.core.client.JavaScriptObject getObject(java.lang.String key) throws Properties.TypeException
key
- The name of the JavaScriptObject property.Properties.TypeException
- If the key is found but the value is not a
JavaScriptObject.public final java.lang.String getString(java.lang.String key) throws Properties.TypeException
key
- The name of the String property.Properties.TypeException
- If the key is found but the value is not a
String.public final void remove(java.lang.String key)
key
- The name of the property to remove.public final void set(java.lang.String key, java.lang.Boolean value)
key
- The name of the property.value
- The value of the property.public final void set(java.lang.String key, java.util.Date value)
key
- The name of the property.value
- The value of the property.public final void set(java.lang.String key, java.lang.Double value)
key
- The name of the property.value
- The value of the property.public final void set(java.lang.String key, com.google.gwt.core.client.JavaScriptObject value)
key
- The name of the property.value
- The value of the property.public final void set(java.lang.String key, java.lang.String value)
key
- The name of the property.value
- The value of the property.public final java.lang.String typeofValue(java.lang.String key)
key
- The name of the property to type check.