public class ObjectHolder<T>
extends Object
Just hold an object
T - the type of object| Constructor and description |
|---|
ObjectHolder()Creates an empty holder. |
ObjectHolder(T object)Creates a holder with an initial object. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public T |
getObject()Returns the currently held object. |
|
public T |
getObject(Supplier<? extends T> def)Returns the currently held object, initializing it from the supplier when needed. |
|
public void |
setObject(T object)Replaces the currently held object. |
Creates an empty holder.
Creates a holder with an initial object.
object - the initial objectReturns the currently held object.
Returns the currently held object, initializing it from the supplier when needed.
def - the supplier used when no object has been setReplaces the currently held object.
object - the object to holdCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.