Enum Priority

  • All Implemented Interfaces:
    Serializable, Comparable<Priority>

    public enum Priority
    extends Enum<Priority>
    Priority of a PlannableOnCalendar. 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
    • 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 name
        NullPointerException - 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, an IllegalArgumentException 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.