Package org.silverpeas.core.calendar
Enum Priority
- java.lang.Object
-
- java.lang.Enum<Priority>
-
- org.silverpeas.core.calendar.Priority
-
- All Implemented Interfaces:
Serializable
,Comparable<Priority>
public enum Priority extends Enum<Priority>
Priority of aPlannableOnCalendar
. A priority is a set value from NORMAL (meaning no further priority) to different level of prioritisation.ICAL specifications : A CUA with a three-level priority scheme of "HIGH", "MEDIUM" and "LOW" is mapped into this property such that a property value in the range of one (US-ASCII decimal 49) to four (US-ASCII decimal 52) specifies "HIGH" priority. A value of five (US-ASCII decimal 53) is the normal or "MEDIUM" priority. A value in the range of six (US- ASCII decimal 54) to nine (US-ASCII decimal 58) is "LOW" priority.
As Silverpeas Handles for now only HIGH or NORMAL, Silverpeas considers LOW as NORMAL.- Author:
- mmoquillon
-
-
Enum Constant Summary
Enum Constants Enum Constant Description HIGH
A high priority means thePlannableOnCalendar
is a priority.NORMAL
A normal priority means in fact no priority.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Priority
fromICalLevel(int iCalLevel)
Gets the Silverpeas priority definition from given ICal priority level.int
getICalLevel()
Gets the ICal level according to the specifications and the Silverpeas rule.static Priority
valueOf(int ordinal)
Computes the correct Priority instance from specified the priority level indicated as a number.static Priority
valueOf(String name)
Returns the enum constant of this type with the specified name.static Priority[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NORMAL
public static final Priority NORMAL
A normal priority means in fact no priority. By default, allPlannableOnCalendar
have a normal priority.
-
HIGH
public static final Priority HIGH
A high priority means thePlannableOnCalendar
is a priority. High priority is the lowest priority of a priorityPlannableOnCalendar
.
-
-
Method Detail
-
values
public static Priority[] 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 (Priority c : Priority.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Priority 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
-
valueOf
public static Priority valueOf(int ordinal)
Computes the correct Priority instance from specified the priority level indicated as a number. If the specified ordinal isn't valid, anIllegalArgumentException
is thrown.- Parameters:
ordinal
- the priority level indicated as a positive number.- Returns:
- a Priority instance matching the specified level.
-
fromICalLevel
public static Priority fromICalLevel(int iCalLevel)
Gets the Silverpeas priority definition from given ICal priority level.- Parameters:
iCalLevel
- the ICal priority level.- Returns:
- the corresponding
Priority
.
-
getICalLevel
public int getICalLevel()
Gets the ICal level according to the specifications and the Silverpeas rule.- Returns:
- ICal priority level.
-
-