Enum SubscriberType
- java.lang.Object
-
- java.lang.Enum<SubscriberType>
-
- org.silverpeas.core.subscription.constant.SubscriberType
-
- All Implemented Interfaces:
Serializable
,Comparable<SubscriberType>
public enum SubscriberType extends Enum<SubscriberType>
The type of a subscriber. It can be either a user or a group of users.- Author:
- Yohann Chastagnier Date: 19/02/13
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SubscriberType
from(String name)
String
getName()
static Collection<SubscriberType>
getValidValues()
All subscriber types are returned into a collection excepted the UNKNOWN one.boolean
isValid()
Is this type is valid?static SubscriberType
valueOf(String name)
Returns the enum constant of this type with the specified name.static SubscriberType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN
public static final SubscriberType UNKNOWN
The type is unknown. Assimilable to nothing.
-
USER
public static final SubscriberType USER
The subscriber is a user.
-
GROUP
public static final SubscriberType GROUP
The subscriber is a group of users.
-
-
Method Detail
-
values
public static SubscriberType[] 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 (SubscriberType c : SubscriberType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SubscriberType 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
-
isValid
public boolean isValid()
Is this type is valid? It is valid if the type of the subscriber isn't unknown.- Returns:
- true if the type of the subscriber is known, false otherwise.
-
getName
public String getName()
-
from
public static SubscriberType from(String name)
-
getValidValues
public static Collection<SubscriberType> getValidValues()
All subscriber types are returned into a collection excepted the UNKNOWN one.- Returns:
- a collection of all of the valid subscriber types.
-
-