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;
16 import java.lang.reflect.Method;
17 import java.lang.reflect.ParameterizedType;
18 import java.lang.reflect.Type;
21 public class TestTokens {
23 public ListenableFuture<String> getString() {
28 public static void main(String[] args) throws NoSuchMethodException {
29 Method getString = TestTokens.class.getMethod("getString");
30 Invokable<?, Object> from = Invokable.from(getString);
31 //TypeToken<?> get = from.getReturnType().resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
32 TypeToken<?> get = from.getReturnType().resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
33 System.out.println(get.getRawType());
36 TypeToken<?> get1 = TypeToken.of(getString.getGenericReturnType()).resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
37 System.out.println("get1 = " + get1);