@Retention(value=CLASS) @Target(value={TYPE_USE,METHOD}) public @interface Self
Self to achieve covariance
with respect to subclasses of the method's declaring class.
Note the ElementType.METHOD target is for internal use only.
This is necessary for generated code where even though the code applies the
Self annotation at the method return type position Java 8 misinterprets
it as a Method annotation, hence the METHOD target here. The METHOD target type
will be removed in a future release.
See the Self Type documentation
for more information.Copyright © 2018. All rights reserved.