T
- type of the target object to extract the value fromR
- type of the result object - the extracted valuepublic abstract class ValueExtractor<T,R> extends Object
MapAttributeConfig attributeConfig = new MapAttributeConfig();
extractorConfig.setName("currency");
extractorConfig.setExtractor("com.bank.CurrencyExtractor");
How to register the newly-defined attribute in a configuration of a Map?
MapConfig mapConfig = (...);
mapConfig.addMapAttributeConfig(attributeConfig);
Extractors may be also defined in the XML configuration.
Please, bear in mind that an extractor may not be added after the map has been instantiated.
All extractor have to be defined upfront in the map's initial configuration.
Reflection-based extraction is the default mechanism - ValueExtractors are an alternative way of getting values
from objects.MultiResult
Constructor and Description |
---|
ValueExtractor() |
Modifier and Type | Method and Description |
---|---|
protected MultiResult<R> |
createMultiResult()
Factory method for the MultiResult
|
abstract R |
extract(T target)
Extracts a value from the given target object.
|
public abstract R extract(T target)
target
- object to extract the value fromMultiResult
protected MultiResult<R> createMultiResult()
MultiResult
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.