org.jclouds.json.internal
Class EnumTypeAdapterThatReturnsFromValue<T extends Enum<T>>

java.lang.Object
  extended by org.jclouds.json.internal.EnumTypeAdapterThatReturnsFromValue<T>
All Implemented Interfaces:
com.google.gson.JsonDeserializer<T>, com.google.gson.JsonSerializer<T>

public class EnumTypeAdapterThatReturnsFromValue<T extends Enum<T>>
extends Object
implements com.google.gson.JsonSerializer<T>, com.google.gson.JsonDeserializer<T>

Author:
Adrian Cole

Constructor Summary
EnumTypeAdapterThatReturnsFromValue()
           
 
Method Summary
 T deserialize(com.google.gson.JsonElement json, Type classOfT, com.google.gson.JsonDeserializationContext context)
           
 com.google.gson.JsonElement serialize(T src, Type typeOfSrc, com.google.gson.JsonSerializationContext context)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumTypeAdapterThatReturnsFromValue

public EnumTypeAdapterThatReturnsFromValue()
Method Detail

serialize

public com.google.gson.JsonElement serialize(T src,
                                             Type typeOfSrc,
                                             com.google.gson.JsonSerializationContext context)
Specified by:
serialize in interface com.google.gson.JsonSerializer<T extends Enum<T>>

deserialize

public T deserialize(com.google.gson.JsonElement json,
                     Type classOfT,
                     com.google.gson.JsonDeserializationContext context)
                              throws com.google.gson.JsonParseException
Specified by:
deserialize in interface com.google.gson.JsonDeserializer<T extends Enum<T>>
Throws:
com.google.gson.JsonParseException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 jclouds. All Rights Reserved.