E - Element typepublic class Holder<E> extends Object
A holder is useful for implementing OUT or IN-OUT parameters.
It is possible to sub-class to receive events on get or set.
| Modifier | Constructor and Description |
|---|---|
protected |
Holder(E e)
Creates a Holder containing a given value.
|
| Modifier and Type | Method and Description |
|---|---|
Holder<E> |
accept(UnaryOperator<E> transform)
Applies a transform to the value.
|
static <E> Holder<E> |
empty()
Creates a holder containing null.
|
E |
get()
Gets the value.
|
static <E> Holder<E> |
of(E e)
Creates a holder containing a given value.
|
void |
set(E e)
Sets the value.
|
public void set(E e)
public E get()
public Holder<E> accept(UnaryOperator<E> transform)
public static <E> Holder<E> of(E e)
public static <E> Holder<E> empty()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.