public class CollectionToMapSplitterTransformer extends Object implements FunctionTransformer
Collection and convert it to a Map based on an identifier. This Transformer will take a Collection
and convert to a Map, where the Map value is the same as the Collection. The key in the Map is constructed using Identifier if provided.
The Identifier is a Transformer set in this bean via setIdentifier(Transformer); which acts on the Collection value and converts into a Key.
identifier Transformer throws ContinueProcessingException then that element will not be added in the Value map (i.e. it will be Skipped)identifier is null and other null conditions| Constructor and Description |
|---|
CollectionToMapSplitterTransformer() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection |
create() |
org.apache.commons.collections.Transformer |
getIdentifier()
From the record identifies which key the node will be associated with.
If the identifier Transformer throws ContinueProcessingException then that element will not be added in the Value map (i.e. |
org.apache.commons.collections.Transformer |
getValueTransformer()
(Optional) Apply over the object to obtain the value in the map
|
boolean |
isMultipleValues()
If true will indicate that the values to the Map are a
Collection and not a singular Object
If false the last value matching the id will be the value |
void |
setIdentifier(org.apache.commons.collections.Transformer identifier)
From the record identifies which key the node will be associated with.
If the identifier Transformer throws ContinueProcessingException then that element will not be added in the Value map (i.e. |
void |
setMultipleValues(boolean multipleValues)
If true will indicate that the values to the Map are a
Collection and not a singular Object
If false the last value matching the id will be the value |
void |
setValueTransformer(org.apache.commons.collections.Transformer valueTransformer)
(Optional) Apply over the object to obtain the value in the map
|
Object |
transform(Object collection) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplyprotected Collection create()
public Object transform(Object collection)
transform in interface org.apache.commons.collections.Transformerpublic org.apache.commons.collections.Transformer getIdentifier()
identifier Transformer throws ContinueProcessingException then that element will not be added in the Value map (i.e. it will be Skipped)
If null then the identifier is the Object in the collection itselfpublic void setIdentifier(org.apache.commons.collections.Transformer identifier)
identifier Transformer throws ContinueProcessingException then that element will not be added in the Value map (i.e. it will be Skipped)
If null then the identifier is the Object in the collection itselfpublic boolean isMultipleValues()
Collection and not a singular Object
public void setMultipleValues(boolean multipleValues)
Collection and not a singular Object
public org.apache.commons.collections.Transformer getValueTransformer()
public void setValueTransformer(org.apache.commons.collections.Transformer valueTransformer)
Copyright © 2018. All rights reserved.