Class AttributeExtractor
java.lang.Object
com.loomcache.server.query.AttributeExtractor
Extracts attribute values from map keys and values using reflection.
Supports three access patterns:
"__key"— returns the key itself"propertyName"— accesses a JavaBean getter, record component, or Map key on the value"nested.path"— dot-separated property path for nested access
Thread-safe: uses a concurrent cache for resolved accessor methods.
-
Field Details
-
KEY_ATTRIBUTE
Special attribute name that returns the key itself.- See Also:
-
THIS_ATTRIBUTE
Special attribute name that returns the value itself.- See Also:
-
-
Method Details
-
extract
Extracts an attribute value from a map entry.- Type Parameters:
K- the key typeV- the value type- Parameters:
key- the map entry keyvalue- the map entry valueattribute- the attribute path (e.g., "__key", "name", "address.city")- Returns:
- the extracted attribute value, or
nullif not found
-