lazyj.notifications
Class Message

java.lang.Object
  extended by lazyj.notifications.Message

public class Message
extends java.lang.Object

The messages are passed by the application through a Notifier, to be delivered by the implementations of Sender specified in the configuration of the Notifier.

Since:
Nov 16, 2007 (1.0.3)
Author:
costing

Field Summary
 java.lang.String sFrom
          Sender of this message.
 java.lang.String sMessage
          Message to be sent.
 java.lang.String sSubject
          Subject / short version of the message
 java.util.Set<java.lang.String> sTo
          Recipients of this message.
 
Constructor Summary
Message(java.lang.String from, java.util.Collection<java.lang.String> to, java.lang.String subject, java.lang.String message)
           
Message(java.lang.String from, java.lang.String to, java.lang.String subject, java.lang.String message)
           
 
Method Summary
 java.lang.String getToAsList()
          Get the list of recipients as a comma-separated string.
static java.util.Set<java.lang.String> listToSet(java.lang.String s)
          Split a comma-separated list into a set of distinct names
static java.lang.String setToList(java.util.Set<java.lang.String> set)
          Convert a set of strings into a comma-separated string
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sFrom

public java.lang.String sFrom
Sender of this message. Can be null if a default sender is defined in the Notifier.


sTo

public java.util.Set<java.lang.String> sTo
Recipients of this message. Any default recipients from the Notifier will be added to this set.


sSubject

public java.lang.String sSubject
Subject / short version of the message


sMessage

public java.lang.String sMessage
Message to be sent.

Constructor Detail

Message

public Message(java.lang.String from,
               java.lang.String to,
               java.lang.String subject,
               java.lang.String message)
Parameters:
from - Sender of this message. Can be null if a default sender is defined in the Notifier.
to - Recipient of this message. Can be null if a default set of recipients is defined in the Notifier.
subject - Subject / short version of the message.
message - Message to be sent.

Message

public Message(java.lang.String from,
               java.util.Collection<java.lang.String> to,
               java.lang.String subject,
               java.lang.String message)
Parameters:
from - Sender of this message. Can be null if a default sender is defined in the Notifier.
to - Recipients of this message. Any default recipients from the Notifier will be added to this set.
subject - Subject / short version of the message.
message - Message to be sent.
Method Detail

getToAsList

public java.lang.String getToAsList()
Get the list of recipients as a comma-separated string.

Returns:
comma-separated list of recipients

setToList

public static java.lang.String setToList(java.util.Set<java.lang.String> set)
Convert a set of strings into a comma-separated string

Parameters:
set -
Returns:
comma-separated list

toString

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

listToSet

public static java.util.Set<java.lang.String> listToSet(java.lang.String s)
Split a comma-separated list into a set of distinct names

Parameters:
s -
Returns:
set of unique names from this comma-separated list of names