E - the type of object the container can carrypublic interface WritableSupplier<E> extends java.util.function.Supplier<E>, java.util.function.Consumer<E>
Supplier by providing additional methods that
allow write access to the contained object.| Modifier and Type | Method and Description |
|---|---|
void |
accept(E instance)
Registers an instance in the container
|
boolean |
isAllowOverwrite()
Returns if an already set object instance may be replaced by another one
|
E |
remove()
Removes the instance (if any) from the container
|
getandThenboolean isAllowOverwrite()
accept(Object)void accept(E instance) throws IllegalStateException
accept in interface java.util.function.Consumer<E>instance - the instance to registerIllegalStateException - if the given instances is not null and there is
already another instance registered and
isAllowOverwrite() is trueisAllowOverwrite()E remove()
null if none
was registeredCopyright © 2017. All rights reserved.