@Retention(value = AnnotationRetention.BINARY)
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FILE, AnnotationTarget.TYPEALIAS])
@Target(value = [ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PACKAGE, ElementType.TYPE])
public annotation OptIn


Allows use of an opt-in API denoted by the given markers in the annotated file, declaration, or expression. If a declaration is annotated with OptIn, its usages are not required to opt-in to that API.

Summary

Public constructors

Public methods

final @NonNull KClass[]

Defines the opt-in API(s) whose usage this annotation allows.

Public constructors

OptIn

public OptIn(@NonNull KClass<@NonNull Annotation> markerClass)

Public methods

getMarkerClass

public final @NonNull KClass[] getMarkerClass()

Defines the opt-in API(s) whose usage this annotation allows.