Record Class DataLock
java.lang.Object
java.lang.Record
org.cryptomator.frontend.fuse.locks.DataLock
- Record Components:
pathComponents- The path, split into path componentsrwLock- The read-write-lock. We need to store a strong reference while in use, because LockManager works with weeak referenceslock- Either therwLock's read or its write lock
- All Implemented Interfaces:
AutoCloseable
public record DataLock(@Unmodifiable List<String> pathComponents, ReadWriteLock rwLock, Lock lock)
extends Record
implements AutoCloseable
A data lock, either for reading (shared) or writing (exclusive).
-
Constructor Summary
ConstructorsConstructorDescriptionDataLock(@Unmodifiable List<String> pathComponents, ReadWriteLock rwLock, Lock lock) Creates an instance of aDataLockrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lock()Returns the value of thelockrecord component.Returns the value of thepathComponentsrecord component.rwLock()Returns the value of therwLockrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DataLock
Creates an instance of aDataLockrecord class.- Parameters:
pathComponents- the value for thepathComponentsrecord componentrwLock- the value for therwLockrecord componentlock- the value for thelockrecord component
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
pathComponents
Returns the value of thepathComponentsrecord component.- Returns:
- the value of the
pathComponentsrecord component
-
rwLock
-
lock
-