Package org.reactfx

Interface Guard

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    BiGuard, CloseableOnceGuard, MultiGuard
    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 Guard
    extends java.lang.AutoCloseable
    • Field Detail

      • EMPTY_GUARD

        static final Guard EMPTY_GUARD
    • Method Detail

      • close

        void close()
        Releases this guard. Does not throw.
        Specified by:
        close in interface java.lang.AutoCloseable
      • closeableOnce

        default Guard closeableOnce()
      • closeableOnce

        static Guard closeableOnce​(Guard guard)
      • multi

        static Guard multi​(Guard... guards)
        Returns a guard that is a composition of multiple guards. Its close() method closes the guards in reverse order.
        Parameters:
        guards - guards that should be released (in reverse order) when the returned guards is released.