Package org.eclipse.birt.report.model.api.metadata

# Class UserChoice

java.lang.Object
org.eclipse.birt.report.model.metadata.Choice
org.eclipse.birt.report.model.api.metadata.UserChoice

All Implemented Interfaces:
  `Cloneable`, `Comparable<Object>`, `IChoice`

public final class UserChoice extends org.eclipse.birt.report.model.metadata.Choice
Describes the user defined choices for a user defined property. The internal name of a choice property is a string. The string maps to a display name shown to the user, and an XML name used in the xml design file. The display name is localized, the XML name is not.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DISPLAY_NAME_PROP`
Name of the display name property.
`protected String`
`displayName`
The choice's display name.
`protected Object`
`value`
The user choice's value, it is required.
`static final String`
`VALUE_PROP`
Name of the choice value property.

### Fields inherited from class org.eclipse.birt.report.model.metadata.Choice

`DISPLAY_NAME_ID_PROP, displayNameKey, messages, name, NAME_PROP`

## Constructor Summary

Constructors
Constructor
Description
`UserChoice(String name, String id)`
Constructs a new User Choice by the given name and id.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDisplayName()`
Returns the property value of "displayName" for the choice.
`Object`
`getValue()`
Gets the value of the user choice.
`void`
`setDisplayName(String name)`
Returns the display name for the choice.
`void`
`setValue(Object theValue)`
Sets the value of the user choice.

### Methods inherited from class org.eclipse.birt.report.model.metadata.Choice

`clone, compareTo, copy, getDisplayName, getDisplayNameKey, getMessages, getName, setDisplayNameKey, setMessages, setName, toString`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### VALUE_PROP

public static final String VALUE_PROP
Name of the choice value property.

See Also:
  - Constant Field Values

### DISPLAY_NAME_PROP

public static final String DISPLAY_NAME_PROP
Name of the display name property.

See Also:
  - Constant Field Values

### displayName

protected String displayName
The choice's display name.

### value

protected Object value
The user choice's value, it is required.

## Constructor Details

### UserChoice

public UserChoice(String name, String id)
Constructs a new User Choice by the given name and id.

Parameters:
  `name` - the choice name
  `id` - the message ID for the display name

## Method Details

### getDisplayName

public String getDisplayName()
Returns the property value of "displayName" for the choice.

Specified by:
  `getDisplayName` in interface `IChoice`
Overrides:
  `getDisplayName` in class `org.eclipse.birt.report.model.metadata.Choice`
Returns:
  the display name for the choice.

### setDisplayName

public void setDisplayName(String name)
Returns the display name for the choice.

Parameters:
  `name` - the display name

### setValue

public void setValue(Object theValue)
Sets the value of the user choice.

Parameters:
  `theValue` - the value of the user choice to set

### getValue

public Object getValue()
Gets the value of the user choice.

Specified by:
  `getValue` in interface `IChoice`
Overrides:
  `getValue` in class `org.eclipse.birt.report.model.metadata.Choice`
Returns:
  the value of the user choice