Class DefaultChangeInfoParser

  • All Implemented Interfaces:
    ChangeInfoParser

    public class DefaultChangeInfoParser
    extends java.lang.Object
    implements ChangeInfoParser
    Implementation of the ChangeInfoParser that 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper()
      Returns object mapper to be used for parsing
      java.util.Optional<ChangeInfo> parse​(java.lang.String info)
      Parses info associated with an item change.
      void setFailOnUnknownProperty​(boolean value)
      Specifies whether to fail parsing and to return Optional.empty() from the parse(String) method, if the info string contains a property that is not "key", "type" or "rootType"
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultChangeInfoParser

        public DefaultChangeInfoParser()
    • Method Detail

      • parse

        public java.util.Optional<ChangeInfo> parse​(java.lang.String info)
        Parses info associated with an item change.
        Specified by:
        parse in interface ChangeInfoParser
        Parameters:
        info - a string calculated from the StreamConfigurationModel.getInfoExpression()
        Returns:
        an optional containing the structured presentation of the parsed info; or Optional.empty(), if the info could not be parsed, or info is null or 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 return Optional.empty() from the parse(String) method, if the info string contains a property that is not "key", "type" or "rootType"
        Parameters:
        value - true, if the parsing should fail; false otherwise.