org.pm4j.core.pm.impl.options
Class PmOptionImpl

java.lang.Object
  extended by org.pm4j.core.pm.impl.options.PmOptionImpl
All Implemented Interfaces:
PmOption

public class PmOptionImpl
extends java.lang.Object
implements PmOption

A simple ui option bean.


Constructor Summary
PmOptionImpl(java.io.Serializable id)
           
PmOptionImpl(java.io.Serializable id, java.lang.String title)
           
PmOptionImpl(java.io.Serializable id, java.lang.String title, boolean enabled)
           
PmOptionImpl(java.io.Serializable id, java.lang.String title, java.lang.Object itemValue)
           
PmOptionImpl(java.io.Serializable id, java.lang.String title, java.lang.Object itemValue, boolean enabled)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.io.Serializable getId()
           
 java.lang.String getIdAsString()
           
 java.lang.String getPmTitle()
           
<T> T
getValue()
          Provides an optional object behind this option.
 int hashCode()
           
 boolean isEnabled()
           
 void setEnabled(boolean enabled)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PmOptionImpl

public PmOptionImpl(java.io.Serializable id)

PmOptionImpl

public PmOptionImpl(java.io.Serializable id,
                    java.lang.String title)

PmOptionImpl

public PmOptionImpl(java.io.Serializable id,
                    java.lang.String title,
                    boolean enabled)

PmOptionImpl

public PmOptionImpl(java.io.Serializable id,
                    java.lang.String title,
                    java.lang.Object itemValue)

PmOptionImpl

public PmOptionImpl(java.io.Serializable id,
                    java.lang.String title,
                    java.lang.Object itemValue,
                    boolean enabled)
Method Detail

getId

public java.io.Serializable getId()
Specified by:
getId in interface PmOption
Returns:
The identifier of the option to select.

getPmTitle

public java.lang.String getPmTitle()
Specified by:
getPmTitle in interface PmOption
Returns:
The localized title.

getValue

public <T> T getValue()
Description copied from interface: PmOption
Provides an optional object behind this option.

Options that represent references to other objects can provide here the presentation model of the referenced object.

Other option implementations e.g. for numeric values might provide a number here. Have a look at the concrete option provider documentation for that.

Specified by:
getValue in interface PmOption
Returns:
The object behind the option or null.

getIdAsString

public java.lang.String getIdAsString()
Specified by:
getIdAsString in interface PmOption
Returns:
The identifier of the option to select as string.

toString

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface PmOption
Returns:
true when the option can be used for setting a value.

setEnabled

public void setEnabled(boolean enabled)