org.silverpeas.mail
Class ReceiverMailAddressSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by java.util.LinkedHashSet<MailAddress>
                  extended by org.silverpeas.mail.ReceiverMailAddressSet
All Implemented Interfaces:
Serializable, Cloneable, Iterable<MailAddress>, Collection<MailAddress>, Set<MailAddress>

public class ReceiverMailAddressSet
extends LinkedHashSet<MailAddress>

This LinkedHashSet implementation handles MailAddress data. It permits to define several receiver addresses and following configuration:

Author:
Yohann Chastagnier
See Also:
Serialized Form

Nested Class Summary
static class ReceiverMailAddressSet.MailRecipientType
           
 
Method Summary
 List<ReceiverMailAddressSet> getBatchedReceiversList()
          Gets the list of receiver batches according to the defined number of receivers per send batch.
 String getEmailsSeparatedByComma()
          Gets the list of emails each one separated by a comma.
 ReceiverMailAddressSet.MailRecipientType getRecipientType()
          Gets the recipient type.
static ReceiverMailAddressSet ofRecipientType(ReceiverMailAddressSet.MailRecipientType mailRecipientType)
          Adds several MailAddress instances.
static ReceiverMailAddressSet with(Collection<MailAddress> mailAddresses)
          Adds several MailAddress instances.
static ReceiverMailAddressSet with(MailAddress... mailAddresses)
          See with(java.util.Collection) details.
 ReceiverMailAddressSet withReceiversBatchSizeOf(int receiversBatchSizeForOneSend)
          Sets the new number of receivers that must be specified for one send.
 ReceiverMailAddressSet withRecipientType(ReceiverMailAddressSet.MailRecipientType recipientType)
          Sets a recipient type.
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

with

public static ReceiverMailAddressSet with(MailAddress... mailAddresses)
See with(java.util.Collection) details.


with

public static ReceiverMailAddressSet with(Collection<MailAddress> mailAddresses)
Adds several MailAddress instances.

Parameters:
mailAddresses - the MailAddress instances.
Returns:

ofRecipientType

public static ReceiverMailAddressSet ofRecipientType(ReceiverMailAddressSet.MailRecipientType mailRecipientType)
Adds several MailAddress instances.

Parameters:
mailRecipientType - the recipient type to take into account.
Returns:

getRecipientType

public ReceiverMailAddressSet.MailRecipientType getRecipientType()
Gets the recipient type.

Returns:
the recepient type.

withRecipientType

public ReceiverMailAddressSet withRecipientType(ReceiverMailAddressSet.MailRecipientType recipientType)
Sets a recipient type. If null, .MailRecipientType#TO is taken in account by default

Parameters:
recipientType - the new recipient type to take into account.
Returns:
the list instance.

withReceiversBatchSizeOf

public ReceiverMailAddressSet withReceiversBatchSizeOf(int receiversBatchSizeForOneSend)
Sets the new number of receivers that must be specified for one send. If the value is less than or equals to zero, then all receivers will be specified in a one single send.

Parameters:
receiversBatchSizeForOneSend - the new number of receivers that must be specified for one send.
Returns:
the list instance.

getBatchedReceiversList

public List<ReceiverMailAddressSet> getBatchedReceiversList()
Gets the list of receiver batches according to the defined number of receivers per send batch.

Returns:
the batched receiver list.

getEmailsSeparatedByComma

public String getEmailsSeparatedByComma()
Gets the list of emails each one separated by a comma.

Returns:
the list of emails each one separated by a comma.


Copyright © 2016 Silverpeas. All Rights Reserved.