|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.config.ConfigResponse
public class ConfigResponse
Field Summary | |
---|---|
static byte[] |
EMPTY_CONFIG
Empty, encoded ConfigResponse. |
Constructor Summary | |
---|---|
ConfigResponse()
Create a ConfigResponse that will not be validated against any schema. |
|
ConfigResponse(ConfigSchema schema)
Create a ConfigResponse that will be validated against the specified schema. |
|
ConfigResponse(java.util.Map attributes)
Create a ConfigResponse that will not be validated against any schema. |
Method Summary | |
---|---|
static ConfigResponse |
decode(byte[] data)
Decode a ConfigResponse from a byte array with no schema validation. |
static ConfigResponse |
decode(ConfigSchema schema,
byte[] data)
Decode a ConfigResponse from a byte array according to the specified schema. |
byte[] |
encode()
|
boolean |
equals(java.lang.Object o)
|
java.util.Set |
getKeys()
|
java.util.List |
getPreferenceAsList(java.lang.String key,
java.lang.String delimiter)
Break the named preference |
java.lang.String |
getValue(java.lang.String key)
|
java.lang.String |
getValue(java.lang.String key,
java.lang.String defaultValue)
|
int |
hashCode()
|
void |
merge(ConfigResponse other,
boolean overWrite)
Merge the values from another ConfigResponse into this object. |
static byte[] |
safeEncode(ConfigResponse cr)
|
void |
setValue(java.lang.String key,
boolean value)
|
void |
setValue(java.lang.String key,
int value)
|
void |
setValue(java.lang.String key,
long value)
|
void |
setValue(java.lang.String key,
java.lang.String value)
Set the value for an option. |
int |
size()
|
java.util.Properties |
toProperties()
|
java.lang.String |
toString()
|
void |
unsetValue(java.lang.String key)
Set the value for an option. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte[] EMPTY_CONFIG
Constructor Detail |
---|
public ConfigResponse(ConfigSchema schema)
schema
- The schema to validate option settings against.
If this is null then no schema validation will be done, this is
equivalent to using the no-argument constructor.public ConfigResponse()
public ConfigResponse(java.util.Map attributes)
attributes
- The config properties normally
populated by setValue().Method Detail |
---|
public void setValue(java.lang.String key, boolean value)
public void setValue(java.lang.String key, int value)
public void setValue(java.lang.String key, long value)
public void setValue(java.lang.String key, java.lang.String value) throws InvalidOptionException, InvalidOptionValueException
setValue
in interface GenericValueMap
key
- The name of the option to setvalue
- The value to set the option to.
InvalidOptionException
- If this ConfigResponse does
not support the specified option.
InvalidOptionValueException
- If the value supplied
is not a legal/valid value for the option.public void unsetValue(java.lang.String key) throws InvalidOptionException, InvalidOptionValueException
key
- The name of the option to set
InvalidOptionException
- If this ConfigResponse does
not support the specified option.
InvalidOptionValueException
- If the value supplied
is not a legal/valid value for the option.public java.lang.String getValue(java.lang.String key)
getValue
in interface GenericValueMap
public java.lang.String getValue(java.lang.String key, java.lang.String defaultValue)
public java.util.Set getKeys()
getKeys
in interface GenericValueMap
public static ConfigResponse decode(byte[] data) throws EncodingException
data
- The response data to decode.
EncodingException
- If the encoding is incorrect.public static ConfigResponse decode(ConfigSchema schema, byte[] data) throws EncodingException, InvalidOptionException, InvalidOptionValueException
schema
- The schema to validate against.data
- The response data to decode.
EncodingException
- If the encoding is incorrect.
InvalidOptionException
- If the data specifies as option
that is not valid for the given schema.
InvalidOptionValueException
- If the data specifies
an illegal/invalid value for one of the options it contains.public static byte[] safeEncode(ConfigResponse cr) throws EncodingException
EncodingException
public byte[] encode() throws EncodingException
EncodingException
public void merge(ConfigResponse other, boolean overWrite)
other
- Other ConfigResponse to merge data fromoverWrite
- If true, values from the 'other' response will
overwrite values with the same name in the object.public java.util.Properties toProperties()
public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.List getPreferenceAsList(java.lang.String key, java.lang.String delimiter) throws InvalidOptionException
delimiter
- the delimeter to break it up bykey
- the name of the preference
List
of String
tokens
InvalidOptionException
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |