Class AsyncFileLock

java.lang.Object
io.vertx.mutiny.core.file.AsyncFileLock
All Implemented Interfaces:
MutinyDelegate

public class AsyncFileLock extends Object implements MutinyDelegate
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.

  • Field Details

  • Constructor Details

    • AsyncFileLock

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

      public AsyncFileLock(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.file.AsyncFileLock getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • 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)