@Documented @Retention(value=RUNTIME) public @interface Exhaustive
Applications of the type qualifier with different values are exclusive, and the enumeration is an exhaustive list of the possible values.
For example, the following defines a type qualifier such that if you know a value is neither @Foo(Color.Red) or @Foo(Color.Blue), then the value must be @Foo(Color.Green). And if you know it is @Foo(Color.Green), you know it cannot be @Foo(Color.Red) or @Foo(Color.Blue)
@TypeQualifier @interface Foo { enum Color {RED, BLUE, GREEN}; @Exhaustive Color value(); }
Copyright © 2015. All rights reserved.