com.incesoft.botplatform.sdk.support
Class DefaultRobotMessage

java.lang.Object
  extended by com.incesoft.botplatform.sdk.support.DefaultRobotMessage
All Implemented Interfaces:
RobotMessage

public class DefaultRobotMessage
extends java.lang.Object
implements RobotMessage

Author:
LiBo

Field Summary
 
Fields inherited from interface com.incesoft.botplatform.sdk.RobotMessage
STYLE_ALL, STYLE_BOLD, STYLE_BOLD_ITALIC, STYLE_ITALIC, STYLE_STRIKE, STYLE_UNDERLINE
 
Constructor Summary
DefaultRobotMessage()
           
DefaultRobotMessage(TextMessage message)
           
 
Method Summary
 void deregisterEmoticon(java.lang.String shortcut)
          Deregister the emoticon After the invocation of this function, the shortcut appearing in the message will show as plain text.
 int getFontColor()
          Get font color of the message
 java.lang.String getFontName()
          Get font name of the message
 int getFontStyle()
          Get font style of the message, as bold, italic, strikeout, underline
 int getInt()
          A util function to get integer content.
 TextMessage getProtocolMessage()
           
 java.lang.String getSignature()
          Get robot message preface.
 java.lang.String getString()
          Get the plain text of the message
 void registerEmoticon(java.lang.String shortcut, java.lang.String filename)
          Register custom emoticon
 RobotMessage setFontColor(int color)
          Set font color of the message
 RobotMessage setFontName(java.lang.String name)
          Set font name of the message
 RobotMessage setFontStyle(int style)
          Set font style of the message, as bold, italic,strikeout, underline
 RobotMessage setInt(int content)
          A util function to set the message text with integer content using setString(String.valueOf(content))
 RobotMessage setSignature(java.lang.String sig)
          Set robot message preface
 RobotMessage setString(java.lang.String content)
          Set the plain text of the message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRobotMessage

public DefaultRobotMessage()

DefaultRobotMessage

public DefaultRobotMessage(TextMessage message)
Method Detail

getString

public java.lang.String getString()
Description copied from interface: RobotMessage
Get the plain text of the message

Specified by:
getString in interface RobotMessage

setString

public RobotMessage setString(java.lang.String content)
Description copied from interface: RobotMessage
Set the plain text of the message

Specified by:
setString in interface RobotMessage
Returns:
RobotMessage

getInt

public int getInt()
           throws java.lang.NumberFormatException
Description copied from interface: RobotMessage
A util function to get integer content. When the content is an integer, this function will return the parsed integer using Integer.parseInt(getString())

Specified by:
getInt in interface RobotMessage
Throws:
java.lang.NumberFormatException

setInt

public RobotMessage setInt(int content)
Description copied from interface: RobotMessage
A util function to set the message text with integer content using setString(String.valueOf(content))

Specified by:
setInt in interface RobotMessage
Returns:
RobotMessage back to the set message

getSignature

public java.lang.String getSignature()
Description copied from interface: RobotMessage
Get robot message preface. eg: xxx says.

Specified by:
getSignature in interface RobotMessage

setSignature

public RobotMessage setSignature(java.lang.String sig)
Description copied from interface: RobotMessage
Set robot message preface

Specified by:
setSignature in interface RobotMessage
Returns:
RobotMessage

getFontName

public java.lang.String getFontName()
Description copied from interface: RobotMessage
Get font name of the message

Specified by:
getFontName in interface RobotMessage

setFontName

public RobotMessage setFontName(java.lang.String name)
Description copied from interface: RobotMessage
Set font name of the message

Specified by:
setFontName in interface RobotMessage
Returns:
RobotMessage

getFontStyle

public int getFontStyle()
Description copied from interface: RobotMessage
Get font style of the message, as bold, italic, strikeout, underline

Specified by:
getFontStyle in interface RobotMessage

setFontStyle

public RobotMessage setFontStyle(int style)
Description copied from interface: RobotMessage
Set font style of the message, as bold, italic,strikeout, underline

Specified by:
setFontStyle in interface RobotMessage
Returns:
RobotMessage

getFontColor

public int getFontColor()
Description copied from interface: RobotMessage
Get font color of the message

Specified by:
getFontColor in interface RobotMessage

setFontColor

public RobotMessage setFontColor(int color)
Description copied from interface: RobotMessage
Set font color of the message

Specified by:
setFontColor in interface RobotMessage
Returns:
RobotMessage

registerEmoticon

public void registerEmoticon(java.lang.String shortcut,
                             java.lang.String filename)
Description copied from interface: RobotMessage
Register custom emoticon

Specified by:
registerEmoticon in interface RobotMessage
Parameters:
shortcut - The shortcut of the emoticon. If shortcut appears in message, it'll show as an icon corresponding to your 'filename'.
filename - The filename of emotion. Submitted to INCE by SP, and a certified file of INCE

deregisterEmoticon

public void deregisterEmoticon(java.lang.String shortcut)
Description copied from interface: RobotMessage
Deregister the emoticon After the invocation of this function, the shortcut appearing in the message will show as plain text.

Specified by:
deregisterEmoticon in interface RobotMessage

getProtocolMessage

public TextMessage getProtocolMessage()