Package esmska.data
Class SMS
- java.lang.Object
-
- esmska.data.SMS
-
public class SMS extends java.lang.ObjectSMS entity class
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSMS.StatusStatus of SMS
-
Constructor Summary
Constructors Constructor Description SMS(java.lang.String number, java.lang.String text, java.lang.String gateway)Shortcut for SMS(number, text, gateway, null, null).SMS(java.lang.String number, java.lang.String text, java.lang.String gateway, java.lang.String name, java.lang.String id)Constructs new SMS.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgenerateID()Generate a new random message ID and return it.java.lang.StringgetGateway()Gateway of the message.java.lang.StringgetId()Get the message ID.javax.swing.ImageIcongetImage()Security image.java.lang.StringgetImageCode()Security image code.java.lang.StringgetImageHint()Hint from gateway where to find security image.java.lang.StringgetName()Name of the recepient.java.lang.StringgetNumber()Recepient number in international format (starting with "+").Tuple<GatewayExecutor.Problem,java.lang.String>getProblem()Get the current problem this SMS has.java.lang.StringgetRecipient()Return name of the recipient, or if that's empty, his numberjava.lang.StringgetSenderName()Sender name.java.lang.StringgetSenderNumber()Sender number.SMS.StatusgetStatus()Status of the message.java.lang.StringgetSupplMsg()Supplemental message from gateway.java.lang.StringgetText()Text of the message.booleanisProblematic()Return whether some error occured during sending.voidsetGateway(java.lang.String gateway)Gateway of the message.voidsetId(java.lang.String id)Set the message ID.voidsetImage(javax.swing.ImageIcon image)Security image.voidsetImageCode(java.lang.String imageCode)Security image code.voidsetImageHint(java.lang.String imageHint)Hint from gateway where to find security image.voidsetName(java.lang.String name)Name of the recipient.voidsetNumber(java.lang.String number)Recepient number in international format (starting with "+").voidsetProblem(Tuple<GatewayExecutor.Problem,java.lang.String> problem)Set the current problem this SMS has.voidsetSupplMsg(java.lang.String supplMsg)Message from gateway.voidsetText(java.lang.String text)Text of the message.java.lang.StringtoDebugString()Return very detailed description of the instance, used mainly for debugging purposes.java.lang.StringtoString()
-
-
-
Constructor Detail
-
SMS
public SMS(java.lang.String number, java.lang.String text, java.lang.String gateway)Shortcut for SMS(number, text, gateway, null, null).
-
SMS
public SMS(java.lang.String number, java.lang.String text, java.lang.String gateway, java.lang.String name, java.lang.String id)Constructs new SMS. For detailed parameters restrictions see individual setter methods.- Parameters:
number- not null nor emptytext- not nullgateway- not null nor emptyname-id-
-
-
Method Detail
-
generateID
public static java.lang.String generateID()
Generate a new random message ID and return it.
-
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.
-
getId
public java.lang.String getId()
Get the message ID. Never empty. This ID is used to mark different parts (fragments) of the same message - they share its ID.
-
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.
-
setId
public void setId(java.lang.String id)
Set the message ID. If empty or null, a random ID is generated. This ID is used to mark different parts (fragments) of the same message - they share its ID.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toDebugString
public java.lang.String toDebugString()
Return very detailed description of the instance, used mainly for debugging purposes.
-
-