Class AsyncFileLock
- All Implemented Interfaces:
MutinyDelegate
AsyncFile.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
AsyncFileLock
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsyncFileLock(io.vertx.core.file.AsyncFileLock delegate) Create a new instance ofAsyncFileLockdelegating to the given (non-null) instance ofAsyncFileLock.AsyncFileLock(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionbooleanio.vertx.core.file.AsyncFileLockGet the delegate instance.inthashCode()booleanisShared()io.smallrye.mutiny.Uni<Boolean>isValid()A lock remains valid until it is released or the file correspondingAsyncFileis closed.A lock remains valid until it is released or the file correspondingAsyncFileis closed.A lock remains valid until it is released or the file correspondingAsyncFileis closed.booleanLikeisValid()but blocking.static AsyncFileLocknewInstance(io.vertx.core.file.AsyncFileLock delegate) Creates a new instance of theAsyncFileLock.booleanoverlaps(long position, long size) longposition()io.smallrye.mutiny.Uni<Void>release()Releases this lock;voidReleases this lock;Releases this lock;voidLikerelease()but blocking.longsize()toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
AsyncFileLock
public AsyncFileLock(io.vertx.core.file.AsyncFileLock delegate) Create a new instance ofAsyncFileLockdelegating to the given (non-null) instance ofAsyncFileLock. -
AsyncFileLock
-
-
Method Details
-
getDelegate
public io.vertx.core.file.AsyncFileLock getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
isValid
A lock remains valid until it is released or the file correspondingAsyncFileis closed.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
AsyncFileLock.isValid()
-
isValidAndAwait
A lock remains valid until it is released or the file correspondingAsyncFileis closed.Unlike the bare Vert.x variant, this method returns a
Boolean. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
AsyncFileLock.isValid()
-
isValidAndForget
A lock remains valid until it is released or the file correspondingAsyncFileis closed.Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
AsyncFileLock.isValid()
-
release
Releases this lock;Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
AsyncFileLock.release()
-
releaseAndAwait
public void releaseAndAwait()Releases this lock;Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
AsyncFileLock.release()
-
releaseAndForget
Releases this lock;Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
AsyncFileLock.release()
-
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) - Returns:
trueif this lock overlaps with the range described bypositionandsize, otherwisefalse
-
isValidBlocking
public boolean isValidBlocking()LikeisValid()but blocking. -
releaseBlocking
public void releaseBlocking()Likerelease()but blocking. -
newInstance
Creates a new instance of theAsyncFileLock. -
hashCode
public int hashCode() -
equals
-
toString
-