# com.bea.content
PropertyChoice Class

public class PropertyChoice
extends `ContentEntity`

PropertyChoice defines a set of choices for a PropertyDefinition, and thus any Property instances based on it.

A choice can be a default, which means if the creator of a Property does not choose different values, it will be set as a Property value. By default, isDefault is false.

If the PropertyChoice value is defined as null, it allows for an empty choice. For example, a Property that has a String type could have 3 PropertyChoices - "blue", "red" and null.

Hierarchy
  `Object`
  `ContentEntity`
  `PropertyChoice`

All Implemented Interfaces
  `Serializable`

## Field Summary

Fields from com.bea.content`.`ContentEntity``
``id``

## Constructor Summary

PropertyChoice() Empty value constructor for a null PropertyChoice.
PropertyChoice(`ID` id, `BinaryValue` binaryValue, `Boolean` booleanValue, `Calendar` calendarValue, `Double` doubleValue, boolean isDefault, `Long` longValue, `String` stringValue) Constructor with all values.
PropertyChoice(`ID` id, `BinaryValue` binaryValue) BinaryValue constructor with id.
PropertyChoice(`ID` id, `Boolean` booleanValue) Boolean constructor with id.
PropertyChoice(`ID` id, `Double` doubleValue) Double constructor.
PropertyChoice(`ID` id, `Long` longValue) Long constructor.
PropertyChoice(`ID` id, `String` stringValue) String constructor.
PropertyChoice(`ID` id, `Calendar` calendarValue) Calendar constructor.

## Method Summary

`public int` | `compareTo`(`Object` obj) Compares this PropertyChoices to obj.
`public `BinaryValue`` | `getBinaryValue`() Gets the BinaryValue.
`public `Boolean`` | `getBooleanValue`() The Boolean choice can be true, false, or null.
`public `Calendar`` | `getCalendarValue`() The Calendar choice can be a Calendar instance, or null.
`public `Double`` | `getDoubleValue`() The Double choice can be a Double instance, or null.
`public `Long`` | `getLongValue`() The Long choice can be a Long instance, or null.
`public `String`` | `getStringValue`() The String choice can be a String instance, or null.
`public `Object`` | `getValue`() Gets the Value as an Object.
`public `Object`` | `getValueByType`(int type) Return the correct value based on the type.
`public void` | `isDefault`(boolean isDefault) Sets if this PropertyChoice is a default.
`public boolean` | `isDefault`() Returns true if this PropertyChoice is a default.
`public void` | `setBinaryValue`(`BinaryValue` binaryValue) Sets the BinaryValue.
`public void` | `setBooleanValue`(`Boolean` booleanValue) Sets the Boolean value to true, false or null.
`public void` | `setCalendarValue`(`Calendar` calendarValue) Sets the Calendar value.
`public void` | `setDefault`(boolean isDefault) Sets if this PropertyChoice is a Default.
`public void` | `setDoubleValue`(`Double` doubleValue) Sets the Double value.
`public void` | `setLongValue`(`Long` longValue) Sets the Long value.
`public void` | `setStringValue`(`String` stringValue) Sets the String value.
`public `String`` | `toString`() Returns the PropertyChoice attributes as a String.

Methods from `com.bea.content.`ContentEntity``
``getId`, `setId`,`

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Detail

### PropertyChoice

    public PropertyChoice()

  Empty value constructor for a null PropertyChoice.

### PropertyChoice

    public PropertyChoice(ID id,
                          BinaryValue binaryValue,
                          Boolean booleanValue,
                          Calendar calendarValue,
                          Double doubleValue,
                          boolean isDefault,
                          Long longValue,
                          String stringValue)

  Constructor with all values.

### PropertyChoice

    public PropertyChoice(ID id,
                          BinaryValue binaryValue)

  BinaryValue constructor with id. IsDefault defaults to false.

### PropertyChoice

    public PropertyChoice(ID id,
                          Boolean booleanValue)

  Boolean constructor with id. IsDefault defaults to false.

### PropertyChoice

    public PropertyChoice(ID id,
                          Double doubleValue)

  Double constructor. IsDefault defaults to false.

### PropertyChoice

    public PropertyChoice(ID id,
                          Long longValue)

  Long constructor. IsDefault defaults to false.

### PropertyChoice

    public PropertyChoice(ID id,
                          String stringValue)

  String constructor. IsDefault defaults to false.

### PropertyChoice

    public PropertyChoice(ID id,
                          Calendar calendarValue)

  Calendar constructor. IsDefault defaults to false.

## Method Detail

### compareTo(Object) Method

    public int compareTo(Object obj)

Compares this PropertyChoices to obj. This performs a native compare on all types, except Calendar is compared based on the time in milliseconds and BinaryValue is compared by name.

### getBinaryValue() Method

    public BinaryValue getBinaryValue()

Gets the BinaryValue.

### getBooleanValue() Method

    public Boolean getBooleanValue()

The Boolean choice can be true, false, or null.

### getCalendarValue() Method

    public Calendar getCalendarValue()

The Calendar choice can be a Calendar instance, or null.

### getDoubleValue() Method

    public Double getDoubleValue()

The Double choice can be a Double instance, or null.

### getLongValue() Method

    public Long getLongValue()

The Long choice can be a Long instance, or null.

### getStringValue() Method

    public String getStringValue()

The String choice can be a String instance, or null.

### getValue() Method

    public Object getValue()

Gets the Value as an Object.

### getValueByType(int) Method

    public Object getValueByType(int type)

Return the correct value based on the type. The user will then cast it to the appropriate object.

### isDefault(boolean) Method

    public void isDefault(boolean isDefault)

Sets if this PropertyChoice is a default.

### isDefault() Method

    public boolean isDefault()

Returns true if this PropertyChoice is a default. There can only be one default per set of PropertyChoices for a PropertyDefinition.

### setBinaryValue(BinaryValue) Method

    public void setBinaryValue(BinaryValue binaryValue)

Sets the BinaryValue.

### setBooleanValue(Boolean) Method

    public void setBooleanValue(Boolean booleanValue)

Sets the Boolean value to true, false or null.

### setCalendarValue(Calendar) Method

    public void setCalendarValue(Calendar calendarValue)

Sets the Calendar value.

### setDefault(boolean) Method

    public void setDefault(boolean isDefault)

Sets if this PropertyChoice is a Default.

### setDoubleValue(Double) Method

    public void setDoubleValue(Double doubleValue)

Sets the Double value.

### setLongValue(Long) Method

    public void setLongValue(Long longValue)

Sets the Long value.

### setStringValue(String) Method

    public void setStringValue(String stringValue)

Sets the String value.

### toString() Method

    public String toString()

Returns the PropertyChoice attributes as a String.

Overrides
  `ContentEntity.toString()`