WeakOuter
Stay organized with collections
Save and categorize content based on your preferences.
Annotation that indicates an inner class has a weak relationship to its owning class.
Lambdas can be given a weak outer reference by declaring a local variable with this annotation
and assigning the lambda expression directly to the local variable. WeakOuter is only allowed on
local variables, not fields, to encourage the annotation to be used where the lambda is declared.
Inherited Method Summary
From interface
java.lang.annotation.Annotation
abstract
Class<? extends Annotation>
|
annotationType()
|
abstract
boolean
|
equals(Object arg0)
|
abstract
int
|
hashCode()
|
abstract
String
|
toString()
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["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."],[[["`@WeakOuter` annotation signifies a weak relationship between an inner class and its outer class, primarily used for lambdas."],["By assigning a lambda expression to a local variable annotated with `@WeakOuter`, the lambda gets a weak reference to the outer class."],["This annotation is exclusively applicable to local variables, encouraging its use at the lambda declaration point."],["`@WeakOuter` inherits methods from `java.lang.annotation.Annotation` including `annotationType()`, `equals()`, `hashCode()`, and `toString()`."]]],[]]