Class LazyReference<T>
java.lang.Object
de.marcely.bedwars.tools.LazyReference<T>
- Type Parameters:
T- The type of the reference
- All Implemented Interfaces:
Supplier<T>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LazyReference
-
-
Method Details
-
get
Gets the reference.- Specified by:
getin interfaceSupplier<T>- Returns:
- The reference
- Throws:
IllegalStateException- If the factory returns null
-
clear
public void clear()Clears the cached reference. -
isCached
public boolean isCached()Checks whether the reference has already been cached.- Returns:
trueif the reference is cached, false otherwise
-
of
-