Package name changes to reflect functionality differences between Library and Plugin.
[ovsdb.git] / ovsdb / src / test / java / org / opendaylight / ovsdb / lib / jsonrpc / TestTokens.java
1 package org.opendaylight.ovsdb.lib.jsonrpc;
2
3 import com.google.common.reflect.Invokable;
4 import com.google.common.reflect.TypeToken;
5 import com.google.common.util.concurrent.ListenableFuture;
6
7 import java.lang.reflect.Method;
8 import java.lang.reflect.ParameterizedType;
9 import java.lang.reflect.Type;
10
11
12 public class TestTokens {
13
14     public ListenableFuture<String> getString() {
15         return null;
16     }
17
18
19     public static void main(String[] args) throws NoSuchMethodException {
20         Method getString = TestTokens.class.getMethod("getString");
21         Invokable<?, Object> from = Invokable.from(getString);
22         //TypeToken<?> get = from.getReturnType().resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
23         TypeToken<?> get = from.getReturnType().resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
24         System.out.println(get.getRawType());
25
26
27         TypeToken<?> get1 = TypeToken.of(getString.getGenericReturnType()).resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
28         System.out.println("get1 = " + get1);
29     }
30
31 }