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 TypeMethodDescriptionbooleanio.vertx.core.file.AsyncFileLockinthashCode()booleanisShared()io.smallrye.mutiny.Uni<Boolean>isValid()LikeisValid()but thehandlerwill be called when the operation completes or if an error occurs.Blocking variant ofisValid().voidVariant ofisValid()that ignores the result of the operation.booleanstatic AsyncFileLocknewInstance(io.vertx.core.file.AsyncFileLock arg) booleanoverlaps(long position, long size) longposition()io.smallrye.mutiny.Uni<Void>release()Likerelease()but thehandlerwill be called when the operation completes or if an error occurs.Blocking variant ofrelease().voidVariant ofrelease()that ignores the result of the operation.voidlongsize()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:
getDelegatein 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:
trueif this lock overlaps with the range described bypositionandsize, otherwisefalse
-
isValidBlocking
public boolean isValidBlocking()- Returns:
-
isValid
LikeisValid()but thehandlerwill 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
unifiring 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 thehandlerwill 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
unifiring 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
-