Package io.vertx.mutiny.core.file
Class AsyncFileLock
java.lang.Object
io.vertx.mutiny.core.file.AsyncFileLock
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsyncFileLock
(io.vertx.core.file.AsyncFileLock delegate) AsyncFileLock
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionboolean
io.vertx.core.file.AsyncFileLock
int
hashCode()
boolean
isShared()
io.smallrye.mutiny.Uni<Boolean>
isValid()
LikeisValid()
but thehandler
will be called when the operation completes or if an error occurs.Blocking variant ofisValid()
.void
Variant ofisValid()
that ignores the result of the operation.boolean
static AsyncFileLock
newInstance
(io.vertx.core.file.AsyncFileLock arg) boolean
overlaps
(long position, long size) long
position()
io.smallrye.mutiny.Uni<Void>
release()
Likerelease()
but thehandler
will be called when the operation completes or if an error occurs.Blocking variant ofrelease()
.void
Variant ofrelease()
that ignores the result of the operation.void
long
size()
toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
AsyncFileLock
public AsyncFileLock(io.vertx.core.file.AsyncFileLock delegate) -
AsyncFileLock
-
-
Method Details
-
getDelegate
public io.vertx.core.file.AsyncFileLock getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
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
-
overlaps
public boolean overlaps(long position, long size) - Parameters:
position
-size
-- Returns:
true
if this lock overlaps with the range described byposition
andsize
, otherwisefalse
-
isValidBlocking
public boolean isValidBlocking()- Returns:
-
isValid
LikeisValid()
but thehandler
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
Blocking variant ofisValid()
.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() -
releaseBlocking
public void releaseBlocking() -
release
Likerelease()
but thehandler
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
Blocking variant ofrelease()
.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() -
newInstance
-