wt.fc
Class EnumeratedType

java.lang.Object
  extended by wt.fc.EnumeratedType
All Implemented Interfaces:
Serializable, Comparable, EnumeratedType, LocalizableMetadata, LocalizableMessage, Message
Direct Known Subclasses:
AccessPermission, AccrualType, ActionItemCategory, ActionItemHealthStatus, ActionItemPriority, ActionItemStatus, AdHocAccessKey, AttributeAccessOperations, AttributeDefinitionDataType, AttributeMappingContext, AuditEventType, AXLPreference, AXLRuleStatus, BusinessDecisionCategory, CalendarType, Category, ChangeNoticeComplexity, ChangeOperation, ChangeStatus, Complexity, ConfirmationCategory, ConstraintType, ContainerTeamManagedState, ContentCategory, ContentRoleType, ContextRelation, DeliveryStatus, DepartmentList, DependencyOption, DocumentType, DynamicEnumType, EffectivityType, EffTypeModifier, EPMApplicationType, EPMAuthoringAppType, EPMConfigurationType, EPMContainedObjectType, EPMDocSubType, EPMDocumentType, EPMPopulateRule, EPMReferenceType, EPMStructureAnnotationType, ESITransactionStatusType, FvMountStatus, GPSEquivalencyActual, GPSParameterGroupAlignment, GPSParameterGroupType, HttpOperationStatus, HttpOperationType, ImportAction, ImportElementAction, ImportJobStatus, ImportMode, ImportSessionStatus, ImportSheetType, ImportSourceFormat, IncludedAs, InputEnabled, InventoryDisposition, IssuePriority, IterationState, MeetingStatus, MeetingType, MesgCategory, MessageType, MPMBranchingConstraintType, MPMCompatibilityLinkType, MPMERPValidationCode, MPMERPValidationCode, MPMMfgProcessCategory, MPMOperationCategory, MPMOperationToPartLinkType, MPMPlantType, MPMPrecedenceConstraintType, MPMProcessMaterialType, MPMProcessPlanCategory, MPMResourceGroupType, MPMResourceType, MPMResourceUsage, MPMReturnConstraintType, MPMSequenceLinkCategory, MPMSkillType, MPMToolingType, MPMWorkCenterType, NetworkRelation, OperationAllocationType, PartCreationState, PartRequestPriority, PartType, ProjectCategory, ProjectEventType, ProjectHealthStatus, ProjectLinkType, ProjectPhase, ProjectRiskValue, QuantityUnit, QueryOperation, RelatedItemsOption, ReleaseActivityAction, ReleaseStatusType, ReplacementType, ReplicationStatus, RequestPriority, ResolutionType, ResourceCategory, ResourceType, ReviseImpact, RuleType, SandboxStatus, ScheduleOpStatus, SeriesRangeSelector, ServerStatus, Source, SpecifiedBy, State, TaskEventMessageType, TaskScope, TaskStatus, TeamCategory, TraceCode, Transition, UIValidationStatus, UsageInfo, VarianceCategory, WfCompletionType, WfDistributionType, WfEmailAttachmentType, WfSynchType, WfTallyType, WorkInProgressState

public abstract class EnumeratedType
extends Object
implements EnumeratedType, Comparable, Serializable

A type that has a defined list of valid values, which may change over time. May optionally have a constant associated to one or more of the valid values (instances) of a sub-type.

The constructors for EnumeratedTypes are protected so that instances can only be constructed internally. The data needed for construction will be obtained from a resource and used to construct the instances, in the static initializer.

Supported API: true

Extendable: true

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface wt.meta.EnumeratedType
DEFAULT_VALUE, ORDER, SELECTABLE
 
Method Summary
 boolean equals(Object obj)
          Determine if two instances are considered equal.
 String getAbbreviatedDisplay()
          Gets the abbreviated display for the metadata element.
 String getDisplay()
          Gets the "standard" display for the metadata element.
 String getDisplay(Locale locale)
          Returns the display text for the specified Locale.
 String getFullDisplay()
          Gets the full display for the metadata element.
 String getLocalizedMessage(Locale locale)
          Obtain a message, localized for the specified locale.
 String getLongDescription()
          Gets the long description for the metadata element.
 int getOrder()
          Gets the value of the attribute: order; The order of a particular instance, when placed in a collection of all valid instances.
 EnumeratedType[] getSelectableValueSet()
          Gets the set of selectable instances for the concrete type of this instance.
 String getShortDescription()
          Gets the short description for the metadata element.
 String getStringValue()
          Gets the string representation of this object, which can later be used to get this instance again.
static String getStringValue(String classname, String internal_value)
          Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.getStringValue(String,String)
abstract  EnumeratedType[] getValueSet()
          Returns the array of possible values (instances) for any specific (derived) EnumeratedType class.
 int hashCode()
          Returns the hasCode() of the internal value.
 boolean isDefaultValue()
          Gets the value of the attribute: defaultValue; Specifies which one of all the valid instances, would be the default value.
 boolean isDefaultValue(Locale locale)
          Determines if instance is the default value for a specific locale; Specifies which one of all the valid instances, would be the default value.
 boolean isSelectable()
          Gets the value of the attribute: selectable; Indicates that the instance is available for selection.
static void main(String[] args)
          Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.main(String[])
static EnumeratedType toEnumeratedType(String stringValue)
          Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.toEnumeratedType(String)
static EnumeratedType toEnumeratedType(String classname, String internal_value)
          Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.toEnumeratedType(String,String)
 String toString()
          Returns the internal (persistent) value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getOrder

public int getOrder()
Gets the value of the attribute: order; The order of a particular instance, when placed in a collection of all valid instances.

Supported API: true

Specified by:
getOrder in interface EnumeratedType
Returns:
int

isDefaultValue

public boolean isDefaultValue()
Gets the value of the attribute: defaultValue; Specifies which one of all the valid instances, would be the default value. One instance may be true, the rest must be false.

Supported API: true

Specified by:
isDefaultValue in interface EnumeratedType
Returns:
boolean

isSelectable

public boolean isSelectable()
Gets the value of the attribute: selectable; Indicates that the instance is available for selection. Provides a means of disallowing the selection of a value in a pick list, while still allowing it as a valid value.

As an example, it may have been valid to select in the past, but is no longer valid to select, even though is it still a valid value to have because of historical selections.

Supported API: true

Specified by:
isSelectable in interface EnumeratedType
Returns:
boolean

equals

public boolean equals(Object obj)
Determine if two instances are considered equal. They are considered equal if their internal values are the same, and the instances are type compatible.

Supported API: true

Overrides:
equals in class Object
Parameters:
obj - another EnumeratedType object to compare against
Returns:
true if considered equal, otherwise false

getDisplay

public String getDisplay(Locale locale)
Returns the display text for the specified Locale. Follows the ResourceBundle algorithm for locating a resource for the locale.

Supported API: true

Specified by:
getDisplay in interface EnumeratedType
Parameters:
locale - the locale for which a display value is requested
Returns:
The display value for the requested locale.

getValueSet

public abstract EnumeratedType[] getValueSet()
Returns the array of possible values (instances) for any specific (derived) EnumeratedType class.

Supported API: true

Returns:
EnumeratedType[]

hashCode

public int hashCode()
Returns the hasCode() of the internal value.

Supported API: true

Overrides:
hashCode in class Object
Returns:
int

toString

public String toString()
Returns the internal (persistent) value. This follows the pattern of primitive wrappers provided by Sun.

Supported API: true

Overrides:
toString in class Object
Returns:
String

getAbbreviatedDisplay

public String getAbbreviatedDisplay()
Gets the abbreviated display for the metadata element.

Supported API: true

Specified by:
getAbbreviatedDisplay in interface LocalizableMetadata
Returns:
String

getDisplay

public String getDisplay()
Gets the "standard" display for the metadata element.

Supported API: true

Specified by:
getDisplay in interface LocalizableMetadata
Returns:
String

getFullDisplay

public String getFullDisplay()
Gets the full display for the metadata element.

Supported API: true

Specified by:
getFullDisplay in interface LocalizableMetadata
Returns:
String

getShortDescription

public String getShortDescription()
Gets the short description for the metadata element.

Supported API: true

Specified by:
getShortDescription in interface LocalizableMetadata
Returns:
String

getLongDescription

public String getLongDescription()
Gets the long description for the metadata element.

Supported API: true

Specified by:
getLongDescription in interface LocalizableMetadata
Returns:
String

main

public static void main(String[] args)
Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.main(String[])

Prints the contents of the specified sub class of EnumeratedType and verifies the contents of the resource bundles.
   Example Usage:
      // for current user's locale
      java wt.fc.EnumeratedType wt.lifecycle.State
 

// for FRENCH locale java wt.fc.EnumeratedType wt.lifecycle.State fr

// for CANADA_FRENCH locale java wt.fc.EnumeratedType wt.lifecycle.State fr CA



Supported API: true

Parameters:
args - a String[] containing the following elements:

[0] fully qualified classname of EnumeratedType sub class

[1] two character language code (optional)

[2] two character country code (optional)

[3] two character variant code (optional)

See Also:
Locale

getStringValue

public String getStringValue()
Gets the string representation of this object, which can later be used to get this instance again. Supported API: true

Returns:
The string representation of an EnumeratedType instance
See Also:
toEnumeratedType(String), getStringValue(String,String)

getStringValue

public static String getStringValue(String classname,
                                    String internal_value)
Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.getStringValue(String,String)

Gets the string representation for an EnumeratedType class and instance value, which can later be used to get that instance.

The format of the string representation is: classname.internal_value

Supported API: true

Parameters:
String - The fully qualified name of the concrete EnumeratedType class.
String - The internal value for a instance of that type.
Returns:
The string representation of an EnumeratedType instance
See Also:
getStringValue()

toEnumeratedType

public static EnumeratedType toEnumeratedType(String classname,
                                              String internal_value)
                                       throws WTInvalidParameterException
Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.toEnumeratedType(String,String)

Gets the instance of the concrete EnumeratedType given the classname and internal_value.

Supported API: true

Parameters:
String - The fully qualified name of the concrete EnumeratedType class.
String - The internal value for a instance of that type.
Returns:
The concrete EnumeratedType instance represented by stringValue. Returns null if passed a null.
Throws:
WTInvalidParameterException
See Also:
getStringValue()

toEnumeratedType

public static EnumeratedType toEnumeratedType(String stringValue)
                                       throws WTInvalidParameterException
Deprecated. Replaced by wt.fc.EnumeratedTypeUtil.toEnumeratedType(String)

Gets the instance of the concrete EnumeratedType given the string representation of the object.

Supported API: true

Parameters:
String - The string representation of an EnumeratedType instance.
Returns:
The concrete EnumeratedType instance represented by stringValue. Returns null if passed a null.
Throws:
WTInvalidParameterException
See Also:
getStringValue()

getLocalizedMessage

public String getLocalizedMessage(Locale locale)
Obtain a message, localized for the specified locale.

Supported API: true

Specified by:
getLocalizedMessage in interface LocalizableMessage
Parameters:
The - locale for which a display name is desired.
Returns:
The localized display name as the localizable message.

isDefaultValue

public boolean isDefaultValue(Locale locale)
Determines if instance is the default value for a specific locale; Specifies which one of all the valid instances, would be the default value. One instance per locale may be true, the rest must be false.

Supported API: true

Specified by:
isDefaultValue in interface EnumeratedType
Parameters:
locale - the locale for which a display value is requested
Returns:
boolean

getSelectableValueSet

public EnumeratedType[] getSelectableValueSet()
Gets the set of selectable instances for the concrete type of this instance.

Supported API: true

Returns:
The array of concrete EnumeratedTypes that are selectable.