Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
@Retention is a meta-annotation used to specify how long an annotation is to be retained.
If no @Retention is specified, it defaults to RetentionPolicy.CLASS.
@Retention only has an effect when used directly on an annotation type, not as a member type.
The RetentionPolicy can be set to SOURCE, CLASS, or RUNTIME to control the annotation's lifespan.
@Retention provides a way to control the visibility and accessibility of annotations during compile time and runtime.
public abstract @interface
Retention
implements
Annotation
Indicates how long annotations with the annotated type are to
be retained. If no Retention annotation is present on
an annotation type declaration, the retention policy defaults to
RetentionPolicy.CLASS.
A Retention meta-annotation has effect only if the
meta-annotated type is used directly for annotation. It has no
effect if the meta-annotated type is used as a member type in
another annotation type.
Returns the hash code of this annotation, as defined below:
The hash code of an annotation is the sum of the hash codes
of its members (including those with default values), as defined
below:
The hash code of an annotation member is (127 times the hash code
of the member-name as computed by String.hashCode()) XOR
the hash code of the member-value, as defined below:
The hash code of a member-value depends on its type:
The hash code of a primitive value v is equal to
WrapperType.valueOf(v).hashCode(), where
WrapperType is the wrapper type corresponding
to the primitive type of v (Byte,
Character, Double, Float, Integer,
Long, Short, or Boolean).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],[]]