LazyLoadBase .java

net.minecraft.util.LazyLoadBase (class, 21 lines): loads. members: isLoaded, load, getValue, value.

net.minecraft.utilclass21 linescommon349 B

API Surface (1)

T getValue()

Fields & Constants (2)

value
isLoaded

Full Source

LazyLoadBase.java21 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.util;
2
3
public abstract class LazyLoadBase<T>
4
{
5
    private T value;
6
    private boolean isLoaded = false;
7
8
    public T getValue()
9
    {
10
        if (!this.isLoaded)
11
        {
12
            this.isLoaded = true;
13
            this.value = this.load();
14
        }
15
16
        return this.value;
17
    }
18
19
    protected abstract T load();
20
}
21

Deobfuscated MCP 1.8.9 source of LazyLoadBase from Marcelektro/MavenMCP-1.8.9 (net/minecraft/util/LazyLoadBase.java), stored verbatim.