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

java.lang.Object
  extended by org.pm4j.core.pm.impl.options.PmOptionSetImpl
All Implemented Interfaces:
PmOptionSet
Direct Known Subclasses:
PmOptionSetImpl.WithIdMap

public class PmOptionSetImpl
extends java.lang.Object
implements PmOptionSet


Nested Class Summary
static class PmOptionSetImpl.WithIdMap
          A special option set that supports optimized association of an option ID to the corresponding option value.
 
Field Summary
 
Fields inherited from interface org.pm4j.core.pm.PmOptionSet
NULL_OPTION_ID
 
Constructor Summary
PmOptionSetImpl(java.util.List<PmOption> pmOptions)
           
PmOptionSetImpl(PmOption... pmOptions)
           
 
Method Summary
 void addOption(PmOption pmOption)
           
 PmOptionImpl addOption(java.io.Serializable id, java.lang.String title)
           
 PmOptionImpl addOption(java.io.Serializable id, java.lang.String title, java.lang.Object value)
           
 PmOption findOptionForId(java.io.Serializable id)
          TODOC:
 PmOption findOptionForIdString(java.lang.String idString)
           
 PmOption findOptionForTitle(java.lang.String title)
           
 PmOption getFirstOption()
           
 java.lang.Object getFirstOptionValue()
           
 PmOption getLastOption()
           
 java.lang.Object getLastOptionValue()
           
 PmOption getOptionForId(java.io.Serializable id)
           
 PmOption getOptionForIdString(java.lang.String idString)
           
 PmOption getOptionForTitle(java.lang.String title)
           
 java.util.List<PmOption> getOptions()
           
 java.lang.Integer getSize()
           
 boolean isMultiselection()
           
 void setMultiselection(boolean multiselection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmOptionSetImpl

public PmOptionSetImpl(java.util.List<PmOption> pmOptions)

PmOptionSetImpl

public PmOptionSetImpl(PmOption... pmOptions)
Method Detail

getOptions

public java.util.List<PmOption> getOptions()
Specified by:
getOptions in interface PmOptionSet
Returns:
The set of options. Returns an empty list when there are no options.

getSize

public java.lang.Integer getSize()
Specified by:
getSize in interface PmOptionSet
Returns:
the number of options

addOption

public void addOption(PmOption pmOption)

addOption

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

addOption

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

getFirstOption

public PmOption getFirstOption()
Specified by:
getFirstOption in interface PmOptionSet
Returns:
The first option of the set. null if there is no option.

getFirstOptionValue

public java.lang.Object getFirstOptionValue()
Specified by:
getFirstOptionValue in interface PmOptionSet
Returns:
The value of the first option. null if there is no option.

getLastOption

public PmOption getLastOption()
Specified by:
getLastOption in interface PmOptionSet
Returns:
The last option of the set. null if there is no option.

getLastOptionValue

public java.lang.Object getLastOptionValue()
Specified by:
getLastOptionValue in interface PmOptionSet
Returns:
The value of the last option. null if there is no option.

findOptionForId

public PmOption findOptionForId(java.io.Serializable id)
Description copied from interface: PmOptionSet
TODOC:

Specified by:
findOptionForId in interface PmOptionSet
Returns:

findOptionForIdString

public PmOption findOptionForIdString(java.lang.String idString)
Specified by:
findOptionForIdString in interface PmOptionSet

getOptionForId

public PmOption getOptionForId(java.io.Serializable id)
Specified by:
getOptionForId in interface PmOptionSet

getOptionForIdString

public PmOption getOptionForIdString(java.lang.String idString)
Specified by:
getOptionForIdString in interface PmOptionSet

findOptionForTitle

public PmOption findOptionForTitle(java.lang.String title)
Specified by:
findOptionForTitle in interface PmOptionSet

getOptionForTitle

public PmOption getOptionForTitle(java.lang.String title)
Specified by:
getOptionForTitle in interface PmOptionSet

isMultiselection

public boolean isMultiselection()
Specified by:
isMultiselection in interface PmOptionSet
Returns:
true when more than one option may be selected.

setMultiselection

public void setMultiselection(boolean multiselection)