Discouraged


@Retention(value = AnnotationRetention.SOURCE)
@Target(allowedTargets = [AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS])
public annotation Discouraged


Denotes that the annotated element, while not disallowed or deprecated, is one that programmers are generally discouraged from using.

Example:

@Discouraged(message = "It is much more efficient to retrieve "
+ "resources by identifier than by name.")
public void getValue(String name) {
...
}

Summary

Public constructors

Public methods

final @NonNull String

Defines the message to display when an element marked with this annotation is used.

Public constructors

Discouraged

public Discouraged(@NonNull String message)

Public methods

getMessage

public final @NonNull String getMessage()

Defines the message to display when an element marked with this annotation is used. An alternative should be provided in the message.