Annotation Interface PermazenMapField
Permazen
Map
fields.
The annotated method's return type must be either Map
<K, V>
,
SortedMap
<K, V>
, or NavigableMap
<K, V>
,
where K
and V
are supported simple types.
Note that both primitive types and their corresponding wrapper types are supported as keys and/or values. A map whose
keys/values have primitive type will throw an exception on an attempt to add a null key/value.
To specify a primitive key or value type, specify the type name (e.g., "int"
) as the PermazenField.encoding()
in the key()
or the value()
.
Meta-Annotations
This annotation may be configured indirectly as a Spring
meta-annotation
when spring-core
is on the classpath.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionConfiguration for the field's keys.The name of this field.int
Storage ID for this field.Configuration for the field's values.
-
Element Details
-
name
String nameThe name of this field.If empty string (default value), the name is inferred from the name of the annotated Java bean getter method.
- Returns:
- the map field name
- Default:
- ""
-
storageId
int storageIdStorage ID for this field.Normally this value is left as zero, in which case a value will be automatically assigned.
Otherwise, the value should be positive and unique within the contained class.
- Returns:
- the field's storage ID, or zero for automatic assignment
- Default:
- 0
-
key
PermazenField keyConfiguration for the field's keys.Normally this property only needs to be set to index the sub-field. If set, the
name
property must be left unset.- Returns:
- configuration for the map key sub-field
- Default:
- @io.permazen.annotation.PermazenField
-
value
PermazenField valueConfiguration for the field's values.Normally this property only needs to be set to index the sub-field. If set, the
name
property must be left unset.- Returns:
- configuration for the map value sub-field
- Default:
- @io.permazen.annotation.PermazenField
-