view src/ie/oshiro/messagepack/jungle/practice/PracticeImplement.java @ 4:a7cd9a10033b

add PracticeEnum
author one
date Sun, 09 Jun 2013 13:13:02 +0900
parents
children
line wrap: on
line source

package ie.oshiro.messagepack.jungle.practice;

import java.io.IOException;

import org.msgpack.MessagePack;
import org.msgpack.annotation.Message;
import org.msgpack.type.Value;

@Message
public class PracticeImplement{

	public static void main(String[] args) throws IOException {
		ImplClassA a = new ImplClassA();
		ImplClassB b = new ImplClassB();
		a.setMessage("set message classA");
		MessagePack msgpack = new MessagePack();
		
		Value aValue = msgpack.unconvert(a);
		Value bValue = msgpack.unconvert(b);
		
		MessagePack msgpack2 = new MessagePack();
		PracticeInterface convertedA = msgpack2.convert(aValue, ImplClassA.class);
		PracticeInterface convertedB = msgpack2.convert(bValue, ImplClassB.class);
		
		convertedA.print();
		convertedB.print();
		
	}

}