Enum NotifChannel
- java.lang.Object
-
- java.lang.Enum<NotifChannel>
-
- org.silverpeas.core.notification.user.client.constant.NotifChannel
-
- All Implemented Interfaces:
Serializable
,Comparable<NotifChannel>
public enum NotifChannel extends Enum<NotifChannel>
Channel used to notify users.- Author:
- Yohann Chastagnier
-
-
Enum Constant Summary
Enum Constants Enum Constant Description POPUP
The notification is sent to the recipient's web browser to be rendered within a popup.REMOVE
The notification is sent to nowhere (it's lost).SERVER
The notification is sent to a remote server, whatever it is.SILVERMAIL
The notification is stored into Silverpeas to be rendered within the user's notifications box in Silverpeas.SMS
The notification is sent by SMS.SMTP
The notification is sent by email.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<NotifChannel>
decode(Integer id)
Decodes the specified channel identifier to a well definedNotifChannel
instance.static Optional<NotifChannel>
decode(String name)
Decodes the specified channel name to the correspondingNotifChannel
instance.int
getId()
BuiltInNotifAddress
getMediaType()
String
getName()
static Collection<Integer>
toIds(Collection<NotifChannel> notifChannels)
static NotifChannel
valueOf(String name)
Returns the enum constant of this type with the specified name.static NotifChannel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SMTP
public static final NotifChannel SMTP
The notification is sent by email.
-
SMS
public static final NotifChannel SMS
The notification is sent by SMS. In that case, the address should be a phone number and the remote server a SMS service of a telecommunication provider.
-
POPUP
public static final NotifChannel POPUP
The notification is sent to the recipient's web browser to be rendered within a popup.
-
SILVERMAIL
public static final NotifChannel SILVERMAIL
The notification is stored into Silverpeas to be rendered within the user's notifications box in Silverpeas.
-
REMOVE
public static final NotifChannel REMOVE
The notification is sent to nowhere (it's lost).
-
SERVER
public static final NotifChannel SERVER
The notification is sent to a remote server, whatever it is.
-
-
Method Detail
-
values
public static NotifChannel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NotifChannel c : NotifChannel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NotifChannel valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getId
public int getId()
-
getName
public String getName()
-
getMediaType
public BuiltInNotifAddress getMediaType()
-
decode
public static Optional<NotifChannel> decode(Integer id)
Decodes the specified channel identifier to a well definedNotifChannel
instance. If the identifier doesn't match to an existingNotifChannel
instance, then nothing is returned.- Parameters:
id
- the unique identifier of a channel.- Returns:
- an optional
NotifChannel
instance corresponding to the given identifier. If no such channel exists for the specified identifier, then nothing is returned.
-
decode
public static Optional<NotifChannel> decode(String name)
Decodes the specified channel name to the correspondingNotifChannel
instance.- Parameters:
name
- the name of a channel.- Returns:
- an optional
NotifChannel
instance. If no such channel exists for the given name, then nothing is returned.
-
toIds
public static Collection<Integer> toIds(Collection<NotifChannel> notifChannels)
-
-