Package net.bytebuddy.utility
Class QueueFactory
java.lang.Object
net.bytebuddy.utility.QueueFactory
A factory for creating a
Queue
. For Java 5, a LinkedList
is created whereas a
java.util.ArrayDeque
is used for any future JVM version.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A dispatcher for creating anjava.util.ArrayDeque
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final QueueFactory.Dispatcher
The dispatcher to use.private static final QueueFactory
The singleton instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> T
doPrivileged
(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivileged
that is activated if available.static <T> Queue<T>
make()
Creates a new queue.static <T> Queue<T>
make
(Collection<? extends T> elements) Creates a new queue.
-
Field Details
-
INSTANCE
The singleton instance. -
dispatcher
The dispatcher to use.
-
-
Constructor Details
-
QueueFactory
private QueueFactory()Creates a new queue factory.
-
-
Method Details
-
make
Creates a new queue.- Type Parameters:
T
- The type of the queue elements.- Returns:
- An appropriate queue.
-
make
Creates a new queue.- Type Parameters:
T
- The type of the queue elements.- Parameters:
elements
- The elements to provide to the queue constructor.- Returns:
- An appropriate queue.
-
doPrivileged
A proxy forjava.security.AccessController#doPrivileged
that is activated if available.- Type Parameters:
T
- The type of the action's resolved value.- Parameters:
action
- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-