Package org.junit.jupiter.api.parallel
Class ResourceLocksProvider.Lock
- java.lang.Object
-
- org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock
-
- Enclosing interface:
- ResourceLocksProvider
public static final class ResourceLocksProvider.Lock extends java.lang.ObjectLockrepresents a shared resource.Each resource is identified by a key. In addition, the access mode allows one to specify whether a test class or test method requires
READ_WRITEorREADaccess to the resource.- Since:
- 5.12
- See Also:
Isolated,Resources,ResourceAccessMode,ResourceLock,ResourceLocksProvider
-
-
Constructor Summary
Constructors Constructor Description Lock(java.lang.String key)Create a newLockwithResourceAccessMode.READ_WRITE.Lock(java.lang.String key, ResourceAccessMode accessMode)Create a newLock.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)ResourceAccessModegetAccessMode()Get the access mode for this lock.java.lang.StringgetKey()Get the key for this lock.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
Lock
public Lock(java.lang.String key)
Create a newLockwithResourceAccessMode.READ_WRITE.- Parameters:
key- the identifier of the resource; nevernullor blank- See Also:
ResourceLock.value()
-
Lock
public Lock(java.lang.String key, ResourceAccessMode accessMode)Create a newLock.- Parameters:
key- the identifier of the resource; nevernullor blankaccessMode- the lock mode to use to synchronize access to the resource; nevernull- See Also:
ResourceLock.value(),ResourceLock.mode()
-
-
Method Detail
-
getKey
public java.lang.String getKey()
Get the key for this lock.- See Also:
ResourceLock.value()
-
getAccessMode
public ResourceAccessMode getAccessMode()
Get the access mode for this lock.- See Also:
ResourceLock.mode()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-