esmska.data
Class SMS

java.lang.Object
  extended by esmska.data.SMS

public class SMS
extends java.lang.Object

SMS entity class


Nested Class Summary
static class SMS.Status
          Status of SMS
 
Constructor Summary
SMS(java.lang.String number, java.lang.String text, java.lang.String gateway)
          Shortcut for SMS(number, text, gateway, null).
SMS(java.lang.String number, java.lang.String text, java.lang.String gateway, java.lang.String name)
          Constructs new SMS.
 
Method Summary
 java.lang.String getGateway()
          Gateway of the message.
 javax.swing.ImageIcon getImage()
          Security image.
 java.lang.String getImageCode()
          Security image code.
 java.lang.String getImageHint()
          Hint from gateway where to find security image.
 java.lang.String getName()
          Name of the recepient.
 java.lang.String getNumber()
          Recepient number in international format (starting with "+").
 Tuple<GatewayExecutor.Problem,java.lang.String> getProblem()
          Get the current problem this SMS has.
 java.lang.String getRecipient()
          Return name of the recipient, or if that's empty, his number
 java.lang.String getSenderName()
          Sender name.
 java.lang.String getSenderNumber()
          Sender number.
 SMS.Status getStatus()
          Status of the message.
 java.lang.String getSupplMsg()
          Supplemental message from gateway.
 java.lang.String getText()
          Text of the message.
 boolean isProblematic()
          Return whether some error occured during sending.
 void setGateway(java.lang.String gateway)
          Gateway of the message.
 void setImage(javax.swing.ImageIcon image)
          Security image.
 void setImageCode(java.lang.String imageCode)
          Security image code.
 void setImageHint(java.lang.String imageHint)
          Hint from gateway where to find security image.
 void setName(java.lang.String name)
          Name of the recipient.
 void setNumber(java.lang.String number)
          Recepient number in international format (starting with "+").
 void setProblem(Tuple<GatewayExecutor.Problem,java.lang.String> problem)
          Set the current problem this SMS has.
 void setSupplMsg(java.lang.String supplMsg)
          Message from gateway.
 void setText(java.lang.String text)
          Text of the message.
 java.lang.String toDebugString()
          Return very detailed description of the instance, used mainly for debugging purposes.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SMS

public SMS(java.lang.String number,
           java.lang.String text,
           java.lang.String gateway)
Shortcut for SMS(number, text, gateway, null).


SMS

public SMS(java.lang.String number,
           java.lang.String text,
           java.lang.String gateway,
           java.lang.String name)
Constructs new SMS. For detailed parameters restrictions see individual setter methods.

Parameters:
number - not null nor empty
text - not null
gateway - not null nor empty
name -
Method Detail

isProblematic

public boolean isProblematic()
Return whether some error occured during sending. SMS is problematic if there is some problem stored.


getRecipient

public java.lang.String getRecipient()
Return name of the recipient, or if that's empty, his number


getNumber

public java.lang.String getNumber()
Recepient number in international format (starting with "+"). Never null nor empty.


getText

public java.lang.String getText()
Text of the message. Never null.


getSenderNumber

public java.lang.String getSenderNumber()
Sender number. Never null.


getSenderName

public java.lang.String getSenderName()
Sender name. Never null.


getImage

public javax.swing.ImageIcon getImage()
Security image. May be null.


getImageCode

public java.lang.String getImageCode()
Security image code. Never null.


getImageHint

public java.lang.String getImageHint()
Hint from gateway where to find security image. May be null.


getGateway

public java.lang.String getGateway()
Gateway of the message. Never null nor empty.


getStatus

public SMS.Status getStatus()
Status of the message. Never null.


getName

public java.lang.String getName()
Name of the recepient. Never null.


getSupplMsg

public java.lang.String getSupplMsg()
Supplemental message from gateway. Never null.


getProblem

public Tuple<GatewayExecutor.Problem,java.lang.String> getProblem()
Get the current problem this SMS has. May be null.


setNumber

public void setNumber(java.lang.String number)
Recepient number in international format (starting with "+"). May not be null nor empty.


setText

public void setText(java.lang.String text)
Text of the message. Not null.


setImage

public void setImage(javax.swing.ImageIcon image)
Security image. May be null.


setImageCode

public void setImageCode(java.lang.String imageCode)
Security image code. Null value is changed to empty string.


setImageHint

public void setImageHint(java.lang.String imageHint)
Hint from gateway where to find security image. May be null.


setGateway

public void setGateway(java.lang.String gateway)
Gateway of the message. May not be null nor empty.


setName

public void setName(java.lang.String name)
Name of the recipient. Null value is changed to empty string.


setSupplMsg

public void setSupplMsg(java.lang.String supplMsg)
Message from gateway. Null value is changed to empty string.


setProblem

public void setProblem(Tuple<GatewayExecutor.Problem,java.lang.String> problem)
Set the current problem this SMS has.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toDebugString

public java.lang.String toDebugString()
Return very detailed description of the instance, used mainly for debugging purposes.