Class DiffConfig

java.lang.Object
eu.maveniverse.domtrip.DiffConfig

public class DiffConfig extends 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:
  • Method Details

    • 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 List<String> matchKeysFor(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