Annotation Interface ListKey


@Retention(RUNTIME) @Target(METHOD) public @interface ListKey
Marks an element as being part of a list item key. All list items must have at least one key (but a synthetic key will be generated if not declared).

This annotation is only used if the interface in which it appears is part of a List in a parent Configuration Object.

For example, the following is a valid use of the ListKey annotation which defines two keys (name and identifier) for a list item (which makes the combination name-identifier unique between items of the list).


 interface HasListItems extends Configuration {

         List<ListItemElement> elements();

         interface ListItemElement {

            @ListKey
             String name();

            @ListKey
             String identifier();

             int value();

         }
     }