Added more ignorable files to .gitignore
[ovsdb.git] / library / src / test / java / org / opendaylight / ovsdb / lib / jsonrpc / TestTokens.java
1 /*
2  * Copyright (C) 2013 EBay Software Foundation
3  *
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
7  *
8  * Authors : Aswin Raveendran
9  */
10 package org.opendaylight.ovsdb.lib.jsonrpc;
11
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;
16
17
18 public class TestTokens {
19
20     public ListenableFuture<String> getString() {
21         return null;
22     }
23
24
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());
31
32
33         TypeToken<?> get1 = TypeToken.of(getString.getGenericReturnType()).resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
34         System.out.println("get1 = " + get1);
35     }
36
37 }