Package io.github.pellse.concurrent
Record Class CoreLock.ReadLock
java.lang.Object
java.lang.Record
io.github.pellse.concurrent.CoreLock.ReadLock
- All Implemented Interfaces:
CoreLock<CoreLock.ReadLock>,Lock<CoreLock.ReadLock>,DelegateAware<CoreLock.ReadLock>
public static record CoreLock.ReadLock(long token, CoreLock<?> outerLock, Consumer<CoreLock.ReadLock> lockReleaser, Thread acquiredOnThread)
extends Record
implements CoreLock<CoreLock.ReadLock>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.pellse.concurrent.CoreLock
CoreLock.NoopLock, CoreLock.ReadLock, CoreLock.WriteLock -
Constructor Summary
ConstructorsConstructorDescriptionReadLock(long token, CoreLock<?> outerLock, Consumer<CoreLock.ReadLock> lockReleaser, Thread acquiredOnThread) Creates an instance of aReadLockrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacquiredOnThreadrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelockReleaserrecord component.CoreLock<?> Returns the value of theouterLockrecord component.longtoken()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ReadLock
public ReadLock(long token, CoreLock<?> outerLock, Consumer<CoreLock.ReadLock> lockReleaser, Thread acquiredOnThread) Creates an instance of aReadLockrecord class.- Parameters:
token- the value for thetokenrecord componentouterLock- the value for theouterLockrecord componentlockReleaser- the value for thelockReleaserrecord componentacquiredOnThread- the value for theacquiredOnThreadrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
token
public long token()Returns the value of thetokenrecord component.- Specified by:
tokenin interfaceLock<CoreLock.ReadLock>- Returns:
- the value of the
tokenrecord component
-
outerLock
Returns the value of theouterLockrecord component.- Specified by:
outerLockin interfaceLock<CoreLock.ReadLock>- Returns:
- the value of the
outerLockrecord component
-
lockReleaser
Returns the value of thelockReleaserrecord component.- Specified by:
lockReleaserin interfaceLock<CoreLock.ReadLock>- Returns:
- the value of the
lockReleaserrecord component
-
acquiredOnThread
Returns the value of theacquiredOnThreadrecord component.- Specified by:
acquiredOnThreadin interfaceLock<CoreLock.ReadLock>- Returns:
- the value of the
acquiredOnThreadrecord component
-