Package eu.maveniverse.domtrip
Class DiffConfig
- java.lang.Object
-
- eu.maveniverse.domtrip.DiffConfig
-
public class DiffConfig extends java.lang.ObjectConfiguration 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiffConfig.BuilderBuilder forDiffConfig.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DiffConfig.Builderbuilder()Returns a new builder for constructing a custom configuration.static DiffConfigdefaults()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.
-
-
-
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
-
-