net.rim.blackberry.api.blackberrymessenger
Class Message
java.lang.Object
net.rim.blackberry.api.blackberrymessenger.Message
public class Message
- extends Object
A container for the data that can be sent or received by the BlackBerry Messenger API.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
Field Summary |
|
static int |
DEFAULT_INTEGER
The default value for the integer, if it is not specified to the constructor. |
|
static String |
DEFAULT_NAME
The default value for the name, if it is not specified to the constructor. |
|
static String |
DEFAULT_URL
The default value for the URL, if it is not specified to the constructor. |
DEFAULT_NAME
public static final String DEFAULT_NAME
- The default value for the name, if it is not specified to the constructor.
The value of this constant is
null
.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
DEFAULT_INTEGER
public static final int DEFAULT_INTEGER
- The default value for the integer, if it is not specified to the constructor.
The value of this constant is
-1
.
- See Also:
- Constant Field Values
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
DEFAULT_URL
public static final String DEFAULT_URL
- The default value for the URL, if it is not specified to the constructor.
The value of this constant is
null
.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
Message
public Message(String contentType,
byte[] data)
- Creates a new
Message
object.
- Parameters:
contentType
- the content type of this message (see Message.getContentType()
).data
- the byte data associated with this message (see Message.getData()
;
note that only the pointer value of specified array is copied, and thus modifications to
the array made outside of this object will be reflected inside of this object also.
- Throws:
NullPointerException
- if any argument is null
.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
Message
public Message(String contentType,
byte[] data,
String name)
- Creates a new
Message
object.
- Parameters:
contentType
- the content type of this message (see Message.getContentType()
)data
- the byte data associated with this message (see Message.getData()
;
note that only the pointer value of specified array is copied, and thus modifications to
the array made outside of this object will be reflected inside of this object also.name
- the name of this message; may be null
(see Message.getName()
)
- Throws:
NullPointerException
- if contentType
or data
is null.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
Message
public Message(String contentType,
byte[] data,
String name,
int integer,
String url)
- Creates a new
Message
object.
- Parameters:
contentType
- the content type of this message (see Message.getContentType()
)data
- the byte data associated with this message (see Message.getData()
;
note that only the pointer value of specified array is copied, and thus modifications to
the array made outside of this object will be reflected inside of this object also.name
- the name of this message; may be null
(see Message.getName()
)integer
- an integer for this message (see Message.getInteger()
)url
- a URL for this message (see Message.getURL()
)
- Throws:
NullPointerException
- if contentType
or data
is null.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
getContentType
public String getContentType()
- Returns the content type of this message.
- Returns:
- the content type of this message; never returns
null
. - See Also:
Message.setContentType(String)
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
setContentType
public void setContentType(String contentType)
- Sets the content type of this message.
- Parameters:
contentType
- the content type to set for this message.
- Throws:
NullPointerException
- if contentType
is null.- See Also:
Message.getContentType()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
getData
public byte[] getData()
- Returns the data of this message.
Note that this method returns the pointer value of the internal array, and thus modifications
to the returned array made outside of this object will be reflected inside this object also.
- Returns:
- the data of this message; never returns
null
. - See Also:
Message.setData(byte[])
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
setData
public void setData(byte[] data)
- Sets the data of this message.
- Parameters:
data
- the data to set for this message; note that only the pointer value of specified
array is copied, and thus modifications to the array made outside of this object will be
reflected in this object also.
- Throws:
NullPointerException
- if data
is null.- See Also:
Message.getData()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
getName
public String getName()
- Returns the name of this message.
- Returns:
- the name of this message; or
null
if this message does not have a name. - See Also:
Message.setName(String)
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
setName
public void setName(String name)
- Sets the name of this message.
- Parameters:
name
- the string to set as the name of this message, or null
to indicate
that this message does not have a name.- See Also:
Message.getName()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
getInteger
public int getInteger()
- Returns an integer associated with this message.
- Returns:
- an integer associated with this message, or
-1
if there is no
integer associated with this message. - See Also:
Message.setInteger(int)
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
setInteger
public void setInteger(int integer)
- Sets the integer of this message.
- Parameters:
integer
- the value to set as the integer of this message.- See Also:
Message.getInteger()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
getURL
public String getURL()
- Returns a URL for this message. The purpose of this URL is for the case that the recipient
does not have the application installed or has an older version that does not recognize a
new content type; the client can download the newer version from this URL.
- Returns:
- a URL for this message; or
null
if no URL is associated with this message. - See Also:
Message.setURL(String)
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
setURL
public void setURL(String url)
- Sets the URL of this message.
- Parameters:
url
- the string to set as the URL of this message; or null
to indicate
that this message does not have a URL.- See Also:
Message.getURL()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.1
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