Class LazyFinal<T>

java.lang.Object
net.dermetfan.utils.LazyFinal<T>

public class LazyFinal<T>
extends java.lang.Object
Enforces the final keyword at runtime.
Since:
0.13.4
  • Constructor Summary

    Constructors
    Constructor Description
    LazyFinal()
    Declaration.
    LazyFinal​(T object)
    Initialization.
  • Method Summary

    Modifier and Type Method Description
    T get()  
    void init​(T object)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LazyFinal

      public LazyFinal()
      Declaration.
    • LazyFinal

      public LazyFinal​(T object)
      Initialization.
      Parameters:
      object - the object to initialize with
  • Method Details

    • init

      public void init​(T object)
      Parameters:
      object - the object
      Throws:
      java.lang.IllegalStateException - if already initialized
    • get

      public T get()
      Returns:
      the object
      Throws:
      java.lang.IllegalStateException - if not yet initialized