com.google.gdata.wireformats
Class ObjectConverter.MappedEnumConverter<T>

java.lang.Object
  extended by com.google.gdata.wireformats.ObjectConverter<T>
      extended by com.google.gdata.wireformats.ObjectConverter.MappedEnumConverter<T>
Enclosing class:
ObjectConverter<T>

public static class ObjectConverter.MappedEnumConverter<T>
extends ObjectConverter<T>

Object converter for pseudo-enum types backed by a map.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.wireformats.ObjectConverter
ObjectConverter.MappedEnumConverter<T>
 
Constructor Summary
ObjectConverter.MappedEnumConverter(java.util.Map<java.lang.String,T> map)
          Creates a converter and links it with a map.
 
Method Summary
 T convertValue(java.lang.String value, java.lang.Class<? extends T> datatype)
          Translate an untyped (string) value to a typed value.
 
Methods inherited from class com.google.gdata.wireformats.ObjectConverter
addConverter, getValue, getValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectConverter.MappedEnumConverter

public ObjectConverter.MappedEnumConverter(java.util.Map<java.lang.String,T> map)
Creates a converter and links it with a map.

Parameters:
map - a map that converts string values into values of the correct type. The caller must make sure the map can be accessed concurrently before adding the resulting converter using ObjectConverter.addConverter(java.lang.Class, com.google.gdata.wireformats.ObjectConverter).
Method Detail

convertValue

public T convertValue(java.lang.String value,
                      java.lang.Class<? extends T> datatype)
               throws ParseException
Description copied from class: ObjectConverter
Translate an untyped (string) value to a typed value.

Specified by:
convertValue in class ObjectConverter<T>
Parameters:
value - value to convert.
Returns:
value converted to type T.
Throws:
ParseException - if value cannot be parsed according to type