Class AsyncFileLock


  • public class AsyncFileLock
    extends Object
    A lock on a region of an AsyncFile.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • AsyncFileLock

        public AsyncFileLock​(io.vertx.core.file.AsyncFileLock delegate)
      • AsyncFileLock

        public AsyncFileLock​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.core.file.AsyncFileLock getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • position

        public long position()
        Returns:
        the position of the first byte of the locked region
      • size

        public long size()
        Returns:
        the size in bytes of the locked region
      • isShared

        public boolean isShared()
        Returns:
        true if this lock is shared, otherwise false
      • overlaps

        public boolean overlaps​(long position,
                                long size)
        Parameters:
        position -
        size -
        Returns:
        true if this lock overlaps with the range described by position and size, otherwise false
      • isValidBlocking

        public boolean isValidBlocking()
        Returns:
      • isValid

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Boolean> isValid()
        Like isValid() but the handler will be called when the operation completes or if an error occurs.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • isValidAndAwait

        public Boolean isValidAndAwait()
        Blocking variant of isValid().

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Returns:
        the Boolean instance produced by the operation.
      • isValidAndForget

        public void isValidAndForget()
        Variant of isValid() that ignores the result of the operation.

        This method subscribes on the result of isValid(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from isValid() but you don't need to compose it with other operations.

      • releaseBlocking

        public void releaseBlocking()
      • release

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> release()
        Like release() but the handler will be called when the operation completes or if an error occurs.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • releaseAndAwait

        public Void releaseAndAwait()
        Blocking variant of release().

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Returns:
        the Void instance produced by the operation.
      • releaseAndForget

        public void releaseAndForget()
        Variant of release() that ignores the result of the operation.

        This method subscribes on the result of release(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from release() but you don't need to compose it with other operations.

      • newInstance

        public static AsyncFileLock newInstance​(io.vertx.core.file.AsyncFileLock arg)