2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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 package org.opendaylight.controller.sal.common.util;
10 import java.util.concurrent.ExecutionException;
11 import java.util.concurrent.Future;
12 import java.util.concurrent.TimeUnit;
13 import java.util.concurrent.TimeoutException;
16 * @deprecated Use {@link com.google.common.util.concurrent.Futures} instead.
19 public class Futures {
24 public static <T> Future<T> immediateFuture(T result) {
25 return new ImmediateFuture<T>(result);
28 private static class ImmediateFuture<T> implements Future<T> {
30 private final T result;
32 public ImmediateFuture(T result) {
37 public boolean cancel(boolean mayInterruptIfRunning) {
42 public boolean isCancelled() {
47 public boolean isDone() {
52 public T get() throws InterruptedException, ExecutionException {
57 public T get(long timeout, TimeUnit unit) throws InterruptedException,
58 ExecutionException, TimeoutException {