GuardedBy
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
public
abstract
@interface
GuardedBy
implements
Annotation
android.support.annotation.GuardedBy
Denotes that the annotated method or field can only be accessed when holding the referenced lock.
Example:
final Object objectLock = new Object();
@GuardedBy("objectLock")
volatile Object object;
Object getObject() {
synchronized (objectLock) {
if (object == null) {
object = new Object();
}
}
return object;
}
Summary
Public methods
String
value ()
Inherited methods
From
interface
java.lang.annotation.Annotation
abstract
Class<? extends Annotation>
annotationType()
abstract
boolean
equals(Object arg0)
abstract
int
hashCode()
abstract
String
toString()
Public methods