org.apache.shindig.protocol.model
Class EnumImpl<E extends Enum.EnumKey>

java.lang.Object
  extended by org.apache.shindig.protocol.model.EnumImpl<E>
All Implemented Interfaces:
Enum<E>

public final class EnumImpl<E extends Enum.EnumKey>
extends Object
implements Enum<E>

Implementation of the Enum interface


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shindig.protocol.model.Enum
Enum.EnumKey, Enum.Field
 
Constructor Summary
EnumImpl(E value)
          Constructs a Enum object.
EnumImpl(E value, String displayValue)
          Constructs a Enum object.
 
Method Summary
 String getDisplayValue()
          Gets the value of this Enum.
 E getValue()
          Gets the key for this Enum.
 void setDisplayValue(String displayValue)
          Sets the value of this Enum.
 void setValue(E value)
          Sets the key for this Enum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumImpl

public EnumImpl(E value,
                String displayValue)
Constructs a Enum object.

Parameters:
value - EnumKey The key to use
displayValue - String The display value

EnumImpl

public EnumImpl(E value)
Constructs a Enum object.

Parameters:
value - The key to use. Will use the value from getDisplayValue() as the display value.
Method Detail

getDisplayValue

public String getDisplayValue()
Description copied from interface: Enum
Gets the value of this Enum. This is the string displayed to the user. If the container supports localization, the string should be localized.

Specified by:
getDisplayValue in interface Enum<E extends Enum.EnumKey>
Returns:
the Enum's user visible value

setDisplayValue

public void setDisplayValue(String displayValue)
Description copied from interface: Enum
Sets the value of this Enum. This is the string displayed to the user. If the container supports localization, the string should be localized.

Specified by:
setDisplayValue in interface Enum<E extends Enum.EnumKey>
Parameters:
displayValue - The value to set.

getValue

public E getValue()
Description copied from interface: Enum
Gets the key for this Enum. Use this for logic within your gadget.

Specified by:
getValue in interface Enum<E extends Enum.EnumKey>
Returns:
java.lang.Enum key object for this Enum.

setValue

public void setValue(E value)
Description copied from interface: Enum
Sets the key for this Enum. Use this for logic within your gadget.

Specified by:
setValue in interface Enum<E extends Enum.EnumKey>
Parameters:
value - The value to set.


Copyright © 2007-2012. All Rights Reserved.