Class DiffConfig


  • public class DiffConfig
    extends java.lang.Object
    Configuration for XML diff operations.

    Controls how elements are matched between two documents. By default, elements are matched positionally among same-name siblings. Configuring match keys enables identity-based matching for domain-specific element types.

    Example:

    
     DiffConfig config = DiffConfig.builder()
         .matchBy("dependency", "groupId", "artifactId")
         .matchBy("*", "id")
         .build();
     
    Since:
    1.3.0
    See Also:
    XmlDiff
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DiffConfig.Builder builder()
      Returns a new builder for constructing a custom configuration.
      static DiffConfig defaults()
      Returns a default configuration with no match keys.
      java.util.List<java.lang.String> matchKeysFor​(java.lang.String elementName)
      Returns the match key attribute or child element names for the given element name, falling back to wildcard keys if no specific keys are configured.
      • Methods inherited from class java.lang.Object

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

      • defaults

        public static DiffConfig defaults()
        Returns a default configuration with no match keys.
        Returns:
        the default configuration
      • builder

        public static DiffConfig.Builder builder()
        Returns a new builder for constructing a custom configuration.
        Returns:
        a new builder instance
      • matchKeysFor

        public java.util.List<java.lang.String> matchKeysFor​(java.lang.String elementName)
        Returns the match key attribute or child element names for the given element name, falling back to wildcard keys if no specific keys are configured.
        Parameters:
        elementName - the element name to look up
        Returns:
        the list of key names, or an empty list if none configured