net.rim.device.api.io.messaging
Class Headers

java.lang.Object
  extended by net.rim.device.api.io.messaging.Headers

public class Headers
extends Object

Encapsulates the headers attached to a Message.

Since:
BlackBerry API 6.0.0

Constructor Summary
Headers(Hashtable headers)
          Constructs a Headers from header key-value pairs specified in a Hashtable.
 
Method Summary
 String getHeader(String key)
          Returns a particular header value by name.
 String[] getHeadersForKey(String key)
          Returns all header values for a particular header key.
 Enumeration headerKeys()
          Returns an enumeration representing all header keys.
 void setHeader(String key, String value)
          Sets a header to a particular value.
 void setHeader(String key, String[] values)
          Sets a header with multiple values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

Headers

public Headers(Hashtable headers)
Constructs a Headers from header key-value pairs specified in a Hashtable.

Parameters:
headers - Key-value pairs of headers.
Since:
BlackBerry API 6.0.0


Method Detail

headerKeys

public Enumeration headerKeys()
Returns an enumeration representing all header keys.

Returns:
Enumeration of header keys.
Since:
BlackBerry API 6.0.0

getHeader

public String getHeader(String key)
Returns a particular header value by name.

Parameters:
key - Name of the header to retrieve.
Returns:
Value of the header.
Since:
BlackBerry API 6.0.0

getHeadersForKey

public String[] getHeadersForKey(String key)
Returns all header values for a particular header key.

Parameters:
key - Name of the header.
Returns:
Array of all values for the header.
Since:
BlackBerry API 6.0.0

setHeader

public void setHeader(String key,
                      String value)
Sets a header to a particular value.

Parameters:
key - Name of the header.
value - Value to set in the header.
Since:
BlackBerry API 6.0.0

setHeader

public void setHeader(String key,
                      String[] values)
Sets a header with multiple values.

Parameters:
key - Name of the header.
values - Array of values to set in the header.
Since:
BlackBerry API 6.0.0





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