Interface TransientListener

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TransientListener
A listener that is expected to only be invoked the next time some event occurs but not for subsequent events. The listener can optionally request that it retained also for the following event.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    invoke(boolean immdediate)
    Invoked when the next event occurs.
  • Method Details

    • invoke

      boolean invoke(boolean immdediate)
      Invoked when the next event occurs. The return value indicates whether the listener should be retained.
      Parameters:
      immdediate - true if the listener is invoked immediately when it is added, false if the event occurred after the listener was added
      Returns:
      true to invoke the listener also for the next event, false to stop invoking the listener