Class DefaultChangeInfoParser
- java.lang.Object
-
- de.hybris.platform.outboundsync.job.impl.DefaultChangeInfoParser
-
- All Implemented Interfaces:
ChangeInfoParser
public class DefaultChangeInfoParser extends java.lang.Object implements ChangeInfoParser
Implementation of theChangeInfoParserthat parses info from a JSON string of the following format:"{ "key": "..", "type": "..", "rootType": ".." }", in which order of the attributes is arbitrary and attribute "key" contains value of the changed item integration key; attribute "type" contains value of the item type; attribute "rootType" contains value of the item type that is navigated from the changed item and corresponds to the root item in the integration object used to synchronize the change.
-
-
Constructor Summary
Constructors Constructor Description DefaultChangeInfoParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.fasterxml.jackson.databind.ObjectMapperobjectMapper()Returns object mapper to be used for parsingjava.util.Optional<ChangeInfo>parse(java.lang.String info)Parses info associated with an item change.voidsetFailOnUnknownProperty(boolean value)Specifies whether to fail parsing and to returnOptional.empty()from theparse(String)method, if the info string contains a property that is not "key", "type" or "rootType"
-
-
-
Method Detail
-
parse
public java.util.Optional<ChangeInfo> parse(java.lang.String info)
Parses info associated with an item change.- Specified by:
parsein interfaceChangeInfoParser- Parameters:
info- a string calculated from theStreamConfigurationModel.getInfoExpression()- Returns:
- an optional containing the structured presentation of the parsed info; or
Optional.empty(), if the info could not be parsed, orinfoisnullor blank.
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper()
Returns object mapper to be used for parsing- Returns:
- an object mapper instance
-
setFailOnUnknownProperty
public void setFailOnUnknownProperty(boolean value)
Specifies whether to fail parsing and to returnOptional.empty()from theparse(String)method, if the info string contains a property that is not "key", "type" or "rootType"- Parameters:
value-true, if the parsing should fail;falseotherwise.
-
-