public @interface Covariant
Ordinarily, Java treats type parameters invariantly: SomeClass<A> is unrelated to (neither a subtype nor a supertype of) SomeClass<B>.
It is only safe to mark a type parameter as covariant if the type parameter is used in a read-only way: values of that type are read from but never modified. This property is not checked; the @Covariant is simply trusted.
The argument to @Covariant is the zero-based indices of the type parameters that should be treated covariantly.
Modifier and Type | Required Element and Description |
---|---|
int[] |
value |