Package io.vertx.reactivex.core.file
Class AsyncFileLock
- java.lang.Object
-
- io.vertx.reactivex.core.file.AsyncFileLock
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class AsyncFileLock extends Object implements io.vertx.lang.rx.RxDelegate
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<AsyncFileLock>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AsyncFileLock(AsyncFileLock delegate)AsyncFileLock(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)AsyncFileLockgetDelegate()inthashCode()booleanisShared()Future<Boolean>isValid()A lock remains valid until it is released or the file correspondingAsyncFileis closed.booleanisValidBlocking()LikeisValid()but blocking.static AsyncFileLocknewInstance(AsyncFileLock arg)booleanoverlaps(long position, long size)longposition()Future<Void>release()Releases this lock;voidreleaseBlocking()Likerelease()but blocking.Single<Boolean>rxIsValid()A lock remains valid until it is released or the file correspondingAsyncFileis closed.CompletablerxRelease()Releases this lock;longsize()StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<AsyncFileLock> __TYPE_ARG
-
-
Constructor Detail
-
AsyncFileLock
public AsyncFileLock(AsyncFileLock delegate)
-
AsyncFileLock
public AsyncFileLock(Object delegate)
-
-
Method Detail
-
getDelegate
public AsyncFileLock getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
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:
trueif this lock is shared, otherwisefalse
-
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()
LikeisValid()but blocking.- Returns:
-
isValid
public Future<Boolean> isValid()
A lock remains valid until it is released or the file correspondingAsyncFileis closed.- Returns:
-
rxIsValid
public Single<Boolean> rxIsValid()
A lock remains valid until it is released or the file correspondingAsyncFileis closed.- Returns:
-
releaseBlocking
public void releaseBlocking()
Likerelease()but blocking.
-
rxRelease
public Completable rxRelease()
Releases this lock;- Returns:
-
newInstance
public static AsyncFileLock newInstance(AsyncFileLock arg)
-
-