@ParametersAreNonnullByDefault public final class LazyBoolean extends Object
boolean by using a BooleanSupplier during the first call to
getAsBoolean().| Modifier and Type | Method and Description |
|---|---|
boolean |
getAsBoolean()
Gets the wrapped value.
|
boolean |
isLoaded()
Returns
true if the value has been loaded. |
static LazyBoolean |
of(boolean value)
Creates a new lazy boolean with the embed value.
|
void |
unload()
Unloads the wrapped value.
|
void |
update(boolean newValue)
Updates the wrapped value.
|
static LazyBoolean |
with(BooleanSupplier loadFunction)
Creates a new lazy boolean with the
BooleanSupplier to load the embed value. |
@Nonnull public static LazyBoolean of(boolean value)
value - the embed value@Nonnull public static LazyBoolean with(BooleanSupplier loadFunction)
BooleanSupplier to load the embed value.loadFunction - the function used to load the valuepublic boolean getAsBoolean()
public void update(boolean newValue)
newValue - the new valuepublic boolean isLoaded()
true if the value has been loaded.true if the value has been loadedpublic void unload()
Copyright © 2017–2019 Atlanmod. All rights reserved.