Class AffinityWithFX.SetOnce<T>

java.lang.Object
etithespirit.orimod.api.environment.defaultimpl.AffinityWithFX.SetOnce<T>
Type Parameters:
T - The type of data stored.
Enclosing class:
AffinityWithFX

public static final class AffinityWithFX.SetOnce<T> extends Object
A single use storage class.
  • Constructor Details

    • SetOnce

      public SetOnce()
  • Method Details

    • set

      public void set(T value) throws IllegalStateException
      Set the value stored within.
      Parameters:
      value - The value to store.
      Throws:
      IllegalStateException - If a value has already been stored.
    • get

      public T get() throws NullPointerException
      Acquire the value stored within.
      Returns:
      The value stored within.
      Throws:
      NullPointerException - If the value has not been set.
    • has

      public boolean has()
      Signifies whether or not the value has been set.
      Returns:
      True if the value has been set, false if it has not.