net.sf.molae.pipe.struts
Class LabelValueEntry

java.lang.Object
  |
  +--net.sf.molae.pipe.struts.LabelValueEntry

public final class LabelValueEntry
extends Object

Implements a bean with a label and a value property on the basis of a Map.Entry. The key of the map entry is mapped to the value property. The value of the map entry is mapped to the label property.


Method Summary
static Collection asLabelValueCollection(Map map)
          Implements a collection of beans with a label and a value property on the basis of a Map.
 String getLabel()
          Returns the value of the underlying map entry.
 String getValue()
          Returns the key of the underlying map entry.
 void setLabel(String label)
          Sets the value of the underlying map entry.
 String toString()
          Returns the string representation of the underlying map entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public String getValue()
Returns the key of the underlying map entry.
Returns:
the key of the underlying map entry
Throws:
ClassCastException - if the key of the base entry is not a String

getLabel

public String getLabel()
Returns the value of the underlying map entry.
Returns:
the value of the underlying map entry
Throws:
ClassCastException - if the value of the base entry is not a String
See Also:
setLabel(String)

setLabel

public void setLabel(String label)
Sets the value of the underlying map entry.
Parameters:
label - a String specifying the label value
Throws:
UnsupportedOperationException - if the base map entry is immutable
ClassCastException - depending on the base map entry
IllegalArgumentException - depending on the base map entry
NullPointerException - depending on the base map entry
See Also:
getLabel()

toString

public String toString()
Returns the string representation of the underlying map entry.
Overrides:
toString in class Object

asLabelValueCollection

public static Collection asLabelValueCollection(Map map)
Implements a collection of beans with a label and a value property on the basis of a Map.
Parameters:
map - the base map
Returns:
a collection of label/value beans based on the specified map.