com.funambol.common.pim.model.converter
Enum CalendarStatus

java.lang.Object
  extended by java.lang.Enum<CalendarStatus>
      extended by com.funambol.common.pim.model.converter.CalendarStatus
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CalendarStatus>

public enum CalendarStatus
extends java.lang.Enum<CalendarStatus>

CalendarStatus enum. Holds all possible status values for the status property of the task. Each enum value holds the value stored server side, the corresponding sif value and the label used in vcal/ical rapresentation.

Version:
$Id: CalendarStatus.java 32831 2009-11-23 10:48:47Z filmac $

Enum Constant Summary
ACCEPTED
           
COMPLETED
           
CONFIRMED
           
DECLINED
           
DELEGATED
           
IN_PROCESS
           
NEEDS_ACTION
           
SENT
           
TENTATIVE
           
 
Field Summary
 short serverValue
           
 short sifValue
           
 
Method Summary
 java.lang.String getICalValue()
           
 java.lang.String getServerValue()
           
static java.lang.String getServerValueFromSifStatus(java.lang.String status)
          Retrieves the server value bound to the given status contained in a SIF-T rapresentation.
static java.lang.String getSifStatusFromServerValue(Property property)
          Retrieves the SIF status bound to the given status property in a Task object.
 java.lang.String getSifValue()
           
 java.lang.String getVCalICalValue(boolean isVcal)
           
 java.lang.String getVCalValue()
           
static CalendarStatus mapServerStatus(Property property)
          retrieves the CalendarStatus bound to the given property.
static CalendarStatus mapSifStatus(java.lang.String status)
          retrieves the CalendarStatus bound to the given string, rapresenting the status of the task contained in a SIF-T rapresentation.
static CalendarStatus mapVcalIcalStatus(Property statusProperty)
          retrieves the CalendarStatus bound to the given Vcal/Ical status property.
static CalendarStatus mapVcalIcalStatus(java.lang.String status)
          retrieves the CalendarStatus bound to the given Vcal/Ical status.
static CalendarStatus valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static CalendarStatus[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ACCEPTED

public static final CalendarStatus ACCEPTED

SENT

public static final CalendarStatus SENT

TENTATIVE

public static final CalendarStatus TENTATIVE

IN_PROCESS

public static final CalendarStatus IN_PROCESS

CONFIRMED

public static final CalendarStatus CONFIRMED

COMPLETED

public static final CalendarStatus COMPLETED

NEEDS_ACTION

public static final CalendarStatus NEEDS_ACTION

DELEGATED

public static final CalendarStatus DELEGATED

DECLINED

public static final CalendarStatus DECLINED
Field Detail

serverValue

public final short serverValue

sifValue

public final short sifValue
Method Detail

values

public static final CalendarStatus[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(CalendarStatus c : CalendarStatus.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static CalendarStatus valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getSifValue

public java.lang.String getSifValue()
Returns:
the sif value bound to this CalendarStatus object as string

getServerValue

public java.lang.String getServerValue()
Returns:
the value stored on the server database if you want to store such a CalendarStatus

getVCalValue

public java.lang.String getVCalValue()

getICalValue

public java.lang.String getICalValue()

getVCalICalValue

public java.lang.String getVCalICalValue(boolean isVcal)

mapServerStatus

public static CalendarStatus mapServerStatus(Property property)
retrieves the CalendarStatus bound to the given property. If the given property is null or it doesn't contain any meaningful information, the ACCEPTED item is returned.

Parameters:
property - is the property of a Task object build server side and it contains a value from 0 to 8.
Returns:
the CalendarStatus item bound to the given property

mapSifStatus

public static CalendarStatus mapSifStatus(java.lang.String status)
retrieves the CalendarStatus bound to the given string, rapresenting the status of the task contained in a SIF-T rapresentation. If the given property is null or it doesn't contain any meaningful information, the ACCEPTED item is returned.

Parameters:
status - is the value of the status tag contained in the SIF-T rapresentation and we expect a value between 0 and 4.
Returns:
the CalendarStatus item bound to the given SIF-T status

mapVcalIcalStatus

public static CalendarStatus mapVcalIcalStatus(java.lang.String status)
retrieves the CalendarStatus bound to the given Vcal/Ical status. If the given property is null or it doesn't contain any meaningful information, the ACCEPTED item is returned.

Parameters:
status - is the string value contained in the Vcal/Ical rapresentation and we expected one of the following values: ACCEPTED (vCal 1.0 & 2.0) SENT (vCal 1.0) TENTATIVE (vCal 1.0 & 2.0) IN-PROCESS (vCal 2.0) CONFIRMED (vCal 1.0) COMPLETED (vCal 1.0 & 2.0) NEEDS-ACTION (vCal 1.0 & 2.0) DELEGATED (vCal 1.0 & 2.0) DECLINED (vCal 1.0 & 2.0)
Returns:
the CalendarStatus item bound to the given property

mapVcalIcalStatus

public static CalendarStatus mapVcalIcalStatus(Property statusProperty)
retrieves the CalendarStatus bound to the given Vcal/Ical status property. If the given property is null or it doesn't contain any meaningful information, the ACCEPTED item is returned.

Parameters:
statusProperty - is the property rapresenting the status value contained in the Vcal/Ical rapresentation and we expected one of the following values: ACCEPTED (vCal 1.0 & 2.0) SENT (vCal 1.0) TENTATIVE (vCal 1.0 & 2.0) IN-PROCESS (vCal 2.0) CONFIRMED (vCal 1.0) COMPLETED (vCal 1.0 & 2.0) NEEDS-ACTION (vCal 1.0 & 2.0) DELEGATED (vCal 1.0 & 2.0) DECLINED (vCal 1.0 & 2.0)
Returns:
the CalendarStatus item bound to the given property

getServerValueFromSifStatus

public static java.lang.String getServerValueFromSifStatus(java.lang.String status)
Retrieves the server value bound to the given status contained in a SIF-T rapresentation. If the given status is null or we're not able to map it, the server value for ACCEPTED is returned.

Parameters:
status - is the value of the status tag contained in the SIF-T rapresentation and we expect a value between 0 and 4.
Returns:
the valued that rapresents server side the given SIF-T status

getSifStatusFromServerValue

public static java.lang.String getSifStatusFromServerValue(Property property)
Retrieves the SIF status bound to the given status property in a Task object.

Parameters:
property - is the status property of a Task object and we expected it may contain a value from 0 to 8 (String).
Returns:
the string rapresenting the value of the status tag in the SIF-T rapresentation of the corresponding task object.


Copyright © 2001-2009 Funambol.