2 * Copyright (C) 2013 EBay Software Foundation
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 * Authors : Aswin Raveendran
10 package org.opendaylight.ovsdb.lib.jsonrpc;
12 import com.google.common.reflect.Invokable;
13 import com.google.common.reflect.TypeToken;
14 import com.google.common.util.concurrent.ListenableFuture;
15 import java.lang.reflect.Method;
18 public class TestTokens {
20 public ListenableFuture<String> getString() {
25 public static void main(String[] args) throws NoSuchMethodException {
26 Method getString = TestTokens.class.getMethod("getString");
27 Invokable<?, Object> from = Invokable.from(getString);
28 //TypeToken<?> get = from.getReturnType().resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
29 TypeToken<?> get = from.getReturnType().resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
30 System.out.println(get.getRawType());
33 TypeToken<?> get1 = TypeToken.of(getString.getGenericReturnType()).resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
34 System.out.println("get1 = " + get1);