Class ConfiguredMergeForgivenessPolicy

  • All Implemented Interfaces:
    java.io.Serializable

    public class ConfiguredMergeForgivenessPolicy
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Field Detail

      • CONFIGURATION_ROOT

        public static final java.lang.String CONFIGURATION_ROOT
        See Also:
        Constant Field Values
      • TYPE_JSON_PROPERTY_VALUE

        public static final java.lang.String TYPE_JSON_PROPERTY_VALUE
        See Also:
        Constant Field Values
      • OWNER_JSON_PROPERTY

        public static final java.lang.String OWNER_JSON_PROPERTY
        See Also:
        Constant Field Values
      • ROOT_LEVEL_POLICY_JSON_PROPERTY

        public static final java.lang.String ROOT_LEVEL_POLICY_JSON_PROPERTY
        See Also:
        Constant Field Values
      • SUB_SEQUENCE_FAILURE_POLICY_JSON_PROPERTY

        public static final java.lang.String SUB_SEQUENCE_FAILURE_POLICY_JSON_PROPERTY
        See Also:
        Constant Field Values
      • EXACT_SEQUENCE_FAILURE_POLICY_JSON_PROPERTY

        public static final java.lang.String EXACT_SEQUENCE_FAILURE_POLICY_JSON_PROPERTY
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConfiguredMergeForgivenessPolicy

        public ConfiguredMergeForgivenessPolicy()
    • Method Detail

      • fromRoot

        public static ConfiguredMergeForgivenessPolicy fromRoot​(org.openstreetmap.atlas.utilities.configuration.Configuration configuration,
                                                                java.lang.String root)
      • applyPolicy

        public java.util.Optional<org.openstreetmap.atlas.geography.atlas.change.FeatureChange> applyPolicy​(org.openstreetmap.atlas.exception.change.FeatureChangeMergeException mergeException,
                                                                                                            org.openstreetmap.atlas.geography.atlas.change.FeatureChange left,
                                                                                                            org.openstreetmap.atlas.geography.atlas.change.FeatureChange right)
        Given some FeatureChangeMergeException and a left and right FeatureChange, attempt to apply the merge forgiveness policies represented by this object. Returns a merged FeatureChange result if possible. This method will fail if the selected policy itself fails. The policy selection will try each of the following policies in this order until it finds one that is defined: 1) exactSequenceFailurePolicy, 2) subSequenceFailurePolicy, 3) rootLevelFailurePolicy.
        Parameters:
        mergeException - the exception detailing the merge failure
        left - the left FeatureChange
        right - the right FeatureChange
        Returns:
        the merged FeatureChange, wrapped in an Optional
      • getOwner

        public java.lang.String getOwner()
      • policyIsEmpty

        public boolean policyIsEmpty()
      • toJson

        public com.google.gson.JsonObject toJson()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object