|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.command.ReadOnlyCommandMetadata
public class ReadOnlyCommandMetadata
Read-only version of CommandMetadata
. Note that this class does not extend CommandMetadata
.
This class decorates a CommandMetadata
instance and provides access only to methods that do not mutate it.
Constructor Summary | ||
---|---|---|
ReadOnlyCommandMetadata(CommandMetadata metadata)
Creates a ReadOnlyCommandMetadata instance. |
Method Summary | ||
---|---|---|
boolean |
getBoolean(String name)
Returns the value associated with a specified attribute name as a boolean. |
|
String |
getClassname()
Returns the command's class name. |
|
CategoryCollection |
getCommandCategories()
Returns the command categories for the associated command. |
|
String |
getCommandId()
Returns the command's identifier. |
|
CategoryCollection |
getContextCategories()
Returns the context categories for the associated command. |
|
int |
getInt(String name)
Returns the value associated with a specified attribute name as an int. |
|
long |
getLong(String name)
Returns the value associated with a specified attribute name as a long. |
|
String |
getResourceBundleName()
Returns the name of the command's resource bundle. |
|
String |
getString(String name)
Returns the value associated with a specified attribute name as a string. |
|
boolean |
has(String name)
Determines if the metadata instance contains a specified attribute name. |
|
int |
hashCode()
Returns a hash code value for the object. |
|
boolean |
optBoolean(String name)
Returns the value associated with a specified attribute name as a boolean. |
|
int |
optInt(String name)
Returns the value associated with a specified attribute name as a int. |
|
int |
optInt(String name,
int defaultValue)
Returns the value associated with a specified attribute name as a int. |
|
long |
optLong(String name)
Returns the value associated with a specified attribute name as a long. |
|
long |
optLong(String name,
long defaultValue)
Returns the value associated with a specified attribute name as a long. |
|
String |
optString(String name)
Returns the value associated with a specified attribute name as a string. |
|
String |
optString(String name,
String defaultValue)
Returns the value associated with a specified attribute name as a string. |
|
String |
toString()
Returns a string representation of the instance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReadOnlyCommandMetadata(CommandMetadata metadata)
ReadOnlyCommandMetadata
instance.
metadata
- CommandMetadata
instance to decorate.
NullPointerException
- if metadata
is null
.Method Detail |
---|
public boolean getBoolean(String name) throws CommandMetadataException
name
- Name of the attribute.
CommandMetadataException
- if name
is not a boolean.CommandMetadata.getBoolean(java.lang.String)
public String getClassname()
CommandMetadata.getClassname()
public String getResourceBundleName()
CommandMetadata.getResourceBundleName()
public CategoryCollection getCommandCategories()
CommandMetadata.getCommandCategories()
public String getCommandId()
CommandMetadata.getCommandId()
public CategoryCollection getContextCategories()
CommandMetadata.getContextCategories()
public int getInt(String name) throws CommandMetadataException
name
- Name of the attribute.
CommandMetadataException
- if name
is not an int.CommandMetadata.getInt(java.lang.String)
public long getLong(String name) throws CommandMetadataException
name
- Name of the attribute.
CommandMetadataException
- if name
is not a long
.CommandMetadata.getLong(java.lang.String)
public String getString(String name) throws CommandMetadataException
name
- Name of the attribute.
CommandMetadataException
- if the value associated with name
is not a string.CommandMetadata.getString(java.lang.String)
public boolean has(String name)
name
- Metadata attribute name to check.
true
if the metadata instance contains the specified name, false
otherwise.CommandMetadata.has(java.lang.String)
public int hashCode()
Object
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
hashCode
in class Object
Object.hashCode()
public boolean optBoolean(String name)
name
- Name of the attribute.
false
if an attribute with the specified name does not exist in the metadata instance.CommandMetadata.optBoolean(java.lang.String)
public int optInt(String name, int defaultValue)
name
- Name of the attribute.defaultValue
- Default value.
defaultValue
if an attribute with the specified name does not exist in the instance.CommandMetadata.optInt(java.lang.String, int)
public int optInt(String name)
name
- Name of the attribute.
null
if an attribute with the specified name does not exist in the metadata instance.public long optLong(String name, long defaultValue)
name
- Name of the attribute.defaultValue
- Default value.
defaultValue
if an attribute with the specified name does not exist in the instance.CommandMetadata.optLong(java.lang.String, long)
public long optLong(String name)
name
- Name of the attribute.
null
if an attribute with the specified name does not exist in the metadata instance.CommandMetadata.optLong(java.lang.String)
public String optString(String name, String defaultValue)
name
- Name of the attribute.defaultValue
- Default value.
defaultValue
if an attribute with the specified name does not exist in the instance.CommandMetadata.optString(java.lang.String, java.lang.String)
public String optString(String name)
name
- Name of the attribute.
null
if an attribute with the specified name does not exist in the metadata instance.CommandMetadata.optString(java.lang.String)
public String toString()
toString
in class Object
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal