com.sap.netweaver.bc.uwl

Class StatusEnum

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.StatusEnum
All Implemented Interfaces:
Comparable, Serializable

public class StatusEnum
extends Object
implements Serializable, Comparable

The StatusEnum class handles enumeration of task's status. An item can have any of the following status in UWL

  1. NEW : When the item is new to the User.
  2. INPROGRESS: Item status can be optionally changed to this by the user to indicate that he is working on it.
  3. EXECUTED: User executes an Item but doesnt confirm or complete it. This is an intermediate optional status.
  4. COMPLETED: This is the last step for an item.
  5. READ: Item could optionally be marked as read in the provider. Item's status can change to NEW or INPROGRESS from being READ depending upon the provider.

See Also:
Serialized Form

Field Summary
static StatusEnum COMPLETED
          This indicates whether or not the task is completed.
static StatusEnum EXECUTED
          This indicates whether or not the task is executed.
static StatusEnum INPROGRESS
          This indicates whether item is in progress.
static StatusEnum NEW
          This indicates whether the task is new.
static StatusEnum READ
          This indicates whether or not the item is read.
protected static String RESOURCE_PREFIX
           
 
Method Summary
 int compareTo(Object arg)
          This method compares the status based on this and arg.
 boolean equals(Object arg)
           
static StatusEnum getEnumFromInternalValue(String val)
           
static StatusEnum getEnumFromText(String text)
           
 String getInternalValue()
           
 String getText()
          Returns the readable text like "NEW","COMPLETED" etc.
 String getText(Locale locale)
          Return the Display text for this enum type.
 int hashCode()
           
static boolean isAllowedInternalValue(String val)
          Do note user this method.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE_PREFIX

protected static final String RESOURCE_PREFIX
See Also:
Constant Field Values

NEW

public static final StatusEnum NEW
This indicates whether the task is new. String constant is 'NEW'


INPROGRESS

public static final StatusEnum INPROGRESS
This indicates whether item is in progress. String constant is 'INPROGRESS'


EXECUTED

public static final StatusEnum EXECUTED
This indicates whether or not the task is executed. Before an item is completed, it might optionally go thro this step as defined by the process. String constant is 'EXECUTED'.


COMPLETED

public static final StatusEnum COMPLETED
This indicates whether or not the task is completed. String constant is 'COMPLETED'


READ

public static final StatusEnum READ
This indicates whether or not the item is read. String constantsis 'READ'. This type of status makes meaning for notifications, alerts etc where end user can mark explicitly that certain items are read using a provider given action.

Method Detail

hashCode

public int hashCode()
Returns:
int the hashCode which is equal to the hashCode of value.
See Also:
Object.hashCode()

getInternalValue

public String getInternalValue()
Returns:
String the value.

toString

public String toString()
Returns:
String the text.
See Also:
Object.toString()

getEnumFromInternalValue

public static StatusEnum getEnumFromInternalValue(String val)
Returns:
StatusEnum If the argument passed is null, it will return null. If it is not one of the types predefined, it will return an instance of StatusEnum with both value and text equal to val.

getText

public String getText()
Returns the readable text like "NEW","COMPLETED" etc.

Returns:

getText

public String getText(Locale locale)
Return the Display text for this enum type. If the text can not be found in the resource bundle The enum key is returned.

Parameters:
locale - - Locale can be null in which the default locale will be used.
Returns:

getEnumFromText

public static StatusEnum getEnumFromText(String text)
Parameters:
text - allowed text e.g. "COMPLETED"
Returns:
could be null

isAllowedInternalValue

public static boolean isAllowedInternalValue(String val)
Do note user this method. Only for internal purpose only.

Parameters:
val - '0' or '1' etc.
Returns:
true if this value exists

compareTo

public int compareTo(Object arg)
This method compares the status based on this and arg. If arg is not an instance of StatusEnum, this method returns 0 indicating equality instead of throwing ClassCastException.

Specified by:
compareTo in interface Comparable
Parameters:
arg - the object that needs to be compared against this.
Returns:
int 1 if this.value is greater than (string comparison) arg.value. Similarly, returns -1 if it is other way around. Returns 0 if they are equal or if arg is not an instance of StatusEnum.
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(Object arg)


Copyright 2006 SAP AG Complete Copyright Notice