public class Holder<T>
extends java.lang.Object
A mutable holder class modeled on the JAX-WS 2.0 Holder class that simply provides a common way of providing an in/out parameter without the need to resort to untidy one length array parameters.
This can also be applied to cases where you need a return value back from a inner or local class. Take for example code that requires the use of the Runnable interface, the following code could be used:
   final Holder<Integer> h = new Holder<>(3);
   SwingUtilities.invokeAndWait(new Runnable()
   {
     public void run()
     {
       h.set(doSomethingClever());
     }
   });
   return 9 + h.get();
 
 Ideally in the above exmaple you would use and API that could make
 use of the Future interface; but in many
 cases API have not been updated.
| Modifier and Type | Method and Description | 
|---|---|
T | 
get()  | 
void | 
set(T value)  | 
java.lang.String | 
toString()  |