Merge "BUG-692 Replace strings with ModifyAction enum"
[controller.git] / opendaylight / md-sal / sal-common-util / src / main / java / org / opendaylight / controller / sal / common / util / Futures.java
index c942159f49ea0c929784e62004bcb661e6ab6cb7..3384e8fb20037d0e9da1e020bf9ae2e744cc24a8 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.sal.common.util;
 
 import java.util.concurrent.ExecutionException;
@@ -5,47 +12,52 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
+/**
+ * @deprecated Use {@link com.google.common.util.concurrent.Futures} instead.
+ */
+@Deprecated
 public class Futures {
 
-       private Futures(){}
-       
-       public static <T> Future<T> immediateFuture(T result) {
-               return new ImmediateFuture<T>(result);
-       }
-       
-       private static class ImmediateFuture<T> implements Future<T> {
-
-               private final T result;
-               
-               public ImmediateFuture(T result) {
-                       this.result = result;
-               }
-               
-               @Override
-               public boolean cancel(boolean mayInterruptIfRunning) {
-                       return false;
-               }
-
-               @Override
-               public boolean isCancelled() {
-                       return false;
-               }
-
-               @Override
-               public boolean isDone() {
-                       return true;
-               }
-
-               @Override
-               public T get() throws InterruptedException, ExecutionException {
-                       return result;
-               }
-
-               @Override
-               public T get(long timeout, TimeUnit unit) throws InterruptedException,
-                               ExecutionException, TimeoutException {
-                       return result;
-               }
-               
-       }
+    private Futures() {
+    }
+
+    public static <T> Future<T> immediateFuture(T result) {
+        return new ImmediateFuture<T>(result);
+    }
+
+    private static class ImmediateFuture<T> implements Future<T> {
+
+        private final T result;
+
+        public ImmediateFuture(T result) {
+            this.result = result;
+        }
+
+        @Override
+        public boolean cancel(boolean mayInterruptIfRunning) {
+            return false;
+        }
+
+        @Override
+        public boolean isCancelled() {
+            return false;
+        }
+
+        @Override
+        public boolean isDone() {
+            return true;
+        }
+
+        @Override
+        public T get() throws InterruptedException, ExecutionException {
+            return result;
+        }
+
+        @Override
+        public T get(long timeout, TimeUnit unit) throws InterruptedException,
+                ExecutionException, TimeoutException {
+            return result;
+        }
+
+    }
 }