com.starbase.starteam
Class EnumeratedValue

java.lang.Object
  |
  +--com.starbase.starteam.EnumeratedValue
Direct Known Subclasses:
ProcessItemUsage

public class EnumeratedValue
extends java.lang.Object

A simple integer/String pair object to be used for adding new custom enumerated fields (Property) and modifying existing enumerated fields (Property).

See Also:
ServerAdministration.addEnumeratedField, ServerAdministration.modifyEnumeratedField

Constructor Summary
EnumeratedValue(int code, java.lang.String description)
          Deprecated. Use the constructor taking a Translations object instead.
EnumeratedValue(int code, Translations translations)
          Creates a new enumerated value with the specified code and translations for its display name.
 
Method Summary
 EnumeratedValue copy()
          Returns a deep copy of this object.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 int getCode()
          Return the enum code for this object.
 java.lang.String getDescription()
          Returns the description of this object.
 java.lang.String getDisplayName()
          Returns the locale appropriate display name for the enumerated value.
 boolean getEnabled()
          Return true if this enumerated value is enabled.
 int getSortOrder()
          Get the sort order of this enumerated value.
 Translations getTranslations()
          Returns the display name translations for this enumerated value.
 int hashCode()
          returns a unique hash for all instances of this type
 void setCode(int code)
          Change the enum code for this object.
 void setDescription(java.lang.String description)
          Change the description for this object.
 void setEnabled(boolean enabled)
          Change the enablement for this enumerated value.
 void setTranslations(Translations translations)
          Sets the display name translations for this enumerated value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumeratedValue

public EnumeratedValue(int code,
                       java.lang.String description)
Deprecated. Use the constructor taking a Translations object instead.

Creates a new enumerated value with the specified code and description.

Parameters:
code - the enum code value
description - a human-readable description of this enumerated value. May not be null.

EnumeratedValue

public EnumeratedValue(int code,
                       Translations translations)
Creates a new enumerated value with the specified code and translations for its display name.

Parameters:
code - the enum code value
translations - the display names for this enumerated value. May not be null.
Method Detail

getCode

public int getCode()
Return the enum code for this object.

Returns:
the enum code for this object.

setCode

public void setCode(int code)
Change the enum code for this object.

Parameters:
code - the new enum code for this object.

getEnabled

public boolean getEnabled()
Return true if this enumerated value is enabled.

Returns:
true if this enumerated value is enabled.

setEnabled

public void setEnabled(boolean enabled)
Change the enablement for this enumerated value.

Parameters:
enabled - true if this enumerated value should be enabled

getDescription

public java.lang.String getDescription()
Returns the description of this object. This may return null if the object was created using a Translations.

Returns:
the description of this object. This may return null.

setDescription

public void setDescription(java.lang.String description)
Change the description for this object.

Parameters:
description - the new description for this object.
Throws:
java.lang.IllegalStateException - if this object was created using a Translations object.

getTranslations

public Translations getTranslations()
Returns the display name translations for this enumerated value. May return null if this was created usng a single description string.


setTranslations

public void setTranslations(Translations translations)
Sets the display name translations for this enumerated value.

Parameters:
translations - the new translations

getDisplayName

public java.lang.String getDisplayName()
Returns the locale appropriate display name for the enumerated value.


getSortOrder

public int getSortOrder()
Get the sort order of this enumerated value.

Returns:
The sort order of this enumerated value.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

copy

public EnumeratedValue copy()
Returns a deep copy of this object.


equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.