Class Listenable<L>

  • Type Parameters:
    L - the listener type

    public abstract class Listenable<L>
    extends java.lang.Object
    Something that has listeners.
    Since:
    4.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Listenable()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addListener0​(L listener)
      Adds a listener.
      protected void forEachListener​(@NotNull java.util.function.Consumer<L> consumer)
      Process an action for each listener.
      protected void removeListener0​(L listener)
      Removes a listener.
      • Methods inherited from class java.lang.Object

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

      • Listenable

        public Listenable()
    • Method Detail

      • forEachListener

        protected final void forEachListener​(@NotNull
                                             @NotNull java.util.function.Consumer<L> consumer)
        Process an action for each listener.
        Parameters:
        consumer - the consumer
        Since:
        4.0.0
      • addListener0

        protected final void addListener0​(@NotNull
                                          L listener)
        Adds a listener.
        Parameters:
        listener - the listener
        Since:
        4.0.0
      • removeListener0

        protected final void removeListener0​(@NotNull
                                             L listener)
        Removes a listener.
        Parameters:
        listener - the listener
        Since:
        4.0.0