Mercurial > hg > Database > jungle-network
comparison src/jungle/test/datasegment/store/operations/DefaultNodePathContainer.java @ 2:20498c88a70d
add Container
author | one |
---|---|
date | Sun, 09 Jun 2013 13:53:16 +0900 |
parents | |
children | 3770d2be3e73 |
comparison
equal
deleted
inserted
replaced
1:8ee02d1a2b12 | 2:20498c88a70d |
---|---|
1 package jungle.test.datasegment.store.operations; | |
2 | |
3 import java.io.IOException; | |
4 import java.util.Arrays; | |
5 import java.util.List; | |
6 | |
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; | |
8 | |
9 import org.msgpack.MessagePack; | |
10 import org.msgpack.annotation.Message; | |
11 import org.msgpack.type.Value; | |
12 | |
13 @Message | |
14 public class DefaultNodePathContainer { | |
15 | |
16 public Value pathValue; | |
17 | |
18 public DefaultNodePathContainer() { | |
19 | |
20 } | |
21 | |
22 public void unconvert(DefaultNodePath path) throws IOException { | |
23 MessagePack msgpack = new MessagePack(); | |
24 List<Integer> list = Arrays.asList(); | |
25 for(Integer i : path) { | |
26 list.add(i); | |
27 } | |
28 Value v = msgpack.unconvert(list); | |
29 pathValue = v; | |
30 } | |
31 | |
32 public DefaultNodePath convert() throws IOException { | |
33 MessagePack msgpack = new MessagePack(); | |
34 return msgpack.convert(pathValue, DefaultNodePath.class); | |
35 } | |
36 | |
37 | |
38 } |