org.msgpack.template
Class OrdinalEnumTemplate<T>

java.lang.Object
  extended by org.msgpack.template.AbstractTemplate<T>
      extended by org.msgpack.template.OrdinalEnumTemplate<T>
All Implemented Interfaces:
Template<T>

public class OrdinalEnumTemplate<T>
extends AbstractTemplate<T>


Field Summary
protected  T[] entries
           
protected  HashMap<T,Integer> reverse
           
 
Constructor Summary
OrdinalEnumTemplate(Class<T> targetClass)
           
 
Method Summary
 T read(Unpacker pac, T to, boolean required)
           
 void write(Packer pk, T target, boolean required)
           
 
Methods inherited from class org.msgpack.template.AbstractTemplate
read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entries

protected T[] entries

reverse

protected HashMap<T,Integer> reverse
Constructor Detail

OrdinalEnumTemplate

public OrdinalEnumTemplate(Class<T> targetClass)
Method Detail

write

public void write(Packer pk,
                  T target,
                  boolean required)
           throws IOException
Throws:
IOException

read

public T read(Unpacker pac,
              T to,
              boolean required)
       throws IOException,
              MessageTypeException
Throws:
IOException
MessageTypeException


Copyright © 2011. All Rights Reserved.