Package esmska.data

Class SMS


  • public class SMS
    extends java.lang.Object
    SMS entity class
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SMS.Status
      Status 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.String generateID()
      Generate a new random message ID and return it.
      java.lang.String getGateway()
      Gateway of the message.
      java.lang.String getId()
      Get the message ID.
      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 setId​(java.lang.String id)
      Set the message ID.
      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, 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 empty
        text - not null
        gateway - not null nor empty
        name -
        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.
      • 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.
      • 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:
        toString in class java.lang.Object
      • toDebugString

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