BUG-5280: make EmptyQueue public 51/44851/1
authorRobert Varga <rovarga@cisco.com>
Thu, 25 Aug 2016 12:13:43 +0000 (14:13 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 30 Aug 2016 09:30:50 +0000 (11:30 +0200)
Allow EmptyQueue to be used externally and correct its javadoc.

Change-Id: I4ae03095844ea235e735ffbdc48f974343a8e9a1
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/EmptyQueue.java

index 31d863a36cf8721de52969ed0bfb5e94dfad4922..1513ebaad6c1dd1c924cfaf800aeb522ef6be585 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.cluster.access.client;
 
  */
 package org.opendaylight.controller.cluster.access.client;
 
+import com.google.common.annotations.Beta;
 import java.util.AbstractQueue;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.AbstractQueue;
 import java.util.Collections;
 import java.util.Iterator;
@@ -21,7 +22,8 @@ import java.util.Queue;
  * @param <E> the type of elements held in this collection
  */
 // TODO: move this class into yangtools.util
  * @param <E> the type of elements held in this collection
  */
 // TODO: move this class into yangtools.util
-final class EmptyQueue<T> extends AbstractQueue<T> {
+@Beta
+public final class EmptyQueue<E> extends AbstractQueue<E> {
     private static final EmptyQueue<?> INSTANCE = new EmptyQueue<>();
 
     private EmptyQueue() {
     private static final EmptyQueue<?> INSTANCE = new EmptyQueue<>();
 
     private EmptyQueue() {
@@ -29,27 +31,27 @@ final class EmptyQueue<T> extends AbstractQueue<T> {
     }
 
     @SuppressWarnings("unchecked")
     }
 
     @SuppressWarnings("unchecked")
-    static <T> Queue<T> getInstance() {
+    public static <T> Queue<T> getInstance() {
         return (Queue<T>) INSTANCE;
     }
 
     @Override
         return (Queue<T>) INSTANCE;
     }
 
     @Override
-    public boolean offer(final T e) {
+    public boolean offer(final E e) {
         return false;
     }
 
     @Override
         return false;
     }
 
     @Override
-    public T poll() {
+    public E poll() {
         return null;
     }
 
     @Override
         return null;
     }
 
     @Override
-    public T peek() {
+    public E peek() {
         return null;
     }
 
     @Override
         return null;
     }
 
     @Override
-    public Iterator<T> iterator() {
+    public Iterator<E> iterator() {
         return Collections.emptyIterator();
     }
 
         return Collections.emptyIterator();
     }