layout: default title: Key Annotation parent: title: Annotations url: annotations.html

Key Annotation

Sets the Key for type conversion.

Usage

The Key annotation must be applied at field or method level.

Parameters

Examples

 // The key property for User objects within the users collection is the <code>userName</code> attribute.
 @Key( value = java.lang.Long.class )
 private Map<Long, User> userMap;