Class ActionReference

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<String>
com.github.ygimenez.model.ActionReference

public class ActionReference extends WeakReference<String>
Class used for checking whether a library action (read: paginate, categorize, buttonize or lazy-paginate action) was already disposed of.
This is a weak reference, so its value might become null at any moment.
See Also:
WeakReference
  • Constructor Details

    • ActionReference

      public ActionReference(@NotNull String referent)
      Creates a new ActionReference for tracking a specific event key. Not for external usage.
      Parameters:
      referent - The key referring to an existing library event.
  • Method Details

    • get

      @Nullable public String get()
      Retrieves the referred action key if it is still active, or null otherwise.
      Overrides:
      get in class Reference<String>
      Returns:
      They key used to represent the library action in the event map.
    • check

      public boolean check()
      Utility method to check whether the referred action is still active.
      Same as doing get() != null.
      Returns:
      Whether the action is still active or not.