@Documented @Target(value=ANNOTATION_TYPE) @Retention(value=RUNTIME) @Beta public @interface MapKey
Map's key type. The defined key type
annotation can be later applied to the key of the Map. Currently
String and enum key types are supported for map binding.
@MapKey(unwrapValue = true)
@Retention(RUNTIME)
public @interface StringKey {
String value();
}
if unwrapValue is false, then the whole annotation will be the key
type for the map and annotation instances will be the keys. If
unwrapValue is true, the value() type of key type annotation will be
the key type for injected map and the value instances will be the keys.| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
unwrapValue
if
unwrapValue is false, then the whole annotation will be the type and annotation
instances will be the keys. |
public abstract boolean unwrapValue
unwrapValue is false, then the whole annotation will be the type and annotation
instances will be the keys. If unwrapValue is true, the value() type of key type
annotation will be the key type for injected map and the value instances will be the keys.
Currently only support unwrapValue to be true.Copyright © 2015 Google, Inc.. All rights reserved.