public class Category
Matching rules category
public static au.com.dius.pact.core.model.matchingrules.Category.Companion Companion
@JvmOverloads
public Category(@NotNull
java.lang.String name,
@NotNull
java.util.Map<java.lang.String,au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup> matchingRules)
Matching rules category
@JvmOverloads
public Category(@NotNull
java.lang.String name)
Matching rules category
@JvmOverloads @NotNull public Category addRule(@NotNull java.lang.String item, @NotNull MatchingRule matchingRule, @NotNull RuleLogic ruleLogic)
Add a rule by key to the given category
@JvmOverloads @NotNull public Category addRule(@NotNull java.lang.String item, @NotNull MatchingRule matchingRule)
Add a rule by key to the given category
@JvmOverloads @NotNull public Category addRule(@NotNull MatchingRule matchingRule, @NotNull RuleLogic ruleLogic)
Add a non-key rule to the given category
@JvmOverloads @NotNull public Category addRule(@NotNull MatchingRule matchingRule)
Add a non-key rule to the given category
@JvmOverloads
public void setRule(@NotNull
java.lang.String item,
@NotNull
MatchingRule matchingRule,
@NotNull
RuleLogic ruleLogic)
Sets rule at the given key
@JvmOverloads
public void setRule(@NotNull
java.lang.String item,
@NotNull
MatchingRule matchingRule)
Sets rule at the given key
@JvmOverloads
public void setRule(@NotNull
MatchingRule matchingRule,
@NotNull
RuleLogic ruleLogic)
Sets a non-key rule
@JvmOverloads
public void setRule(@NotNull
MatchingRule matchingRule)
Sets a non-key rule
@JvmOverloads
public void setRules(@NotNull
java.lang.String item,
@NotNull
java.util.List<? extends au.com.dius.pact.core.model.matchingrules.MatchingRule> rules,
@NotNull
RuleLogic ruleLogic)
Sets all the rules to the provided key
@JvmOverloads
public void setRules(@NotNull
java.lang.String item,
@NotNull
java.util.List<? extends au.com.dius.pact.core.model.matchingrules.MatchingRule> rules)
Sets all the rules to the provided key
@JvmOverloads
public void setRules(@NotNull
java.util.List<? extends au.com.dius.pact.core.model.matchingrules.MatchingRule> matchingRules,
@NotNull
RuleLogic ruleLogic)
Sets all the rules as non-keyed rules
@JvmOverloads
public void setRules(@NotNull
java.util.List<? extends au.com.dius.pact.core.model.matchingrules.MatchingRule> matchingRules)
Sets all the rules as non-keyed rules
public void setRules(@NotNull
java.lang.String item,
@NotNull
MatchingRuleGroup rules)
Sets the matching rule group at the provided key
public boolean isEmpty()
If the rules are empty
public boolean isNotEmpty()
If the rules are not empty
@NotNull public Category filter(@NotNull java.util.function.Predicate<java.lang.String> predicate)
Returns a new Category filtered by the predicate
@Deprecated @NotNull public MatchingRuleGroup maxBy(@NotNull java.util.function.ToIntFunction<java.lang.String> fn)
@NotNull public MatchingRuleGroup maxBy(@NotNull java.util.Comparator<java.lang.String> comparator)
@NotNull public java.util.List<au.com.dius.pact.core.model.matchingrules.MatchingRule> allMatchingRules()
Returns all the matching rules
@JvmOverloads
public void addRules(@NotNull
java.lang.String item,
@NotNull
java.util.List<? extends au.com.dius.pact.core.model.matchingrules.MatchingRule> rules,
@NotNull
RuleLogic ruleLogic)
Adds all the rules to the given key
@JvmOverloads
public void addRules(@NotNull
java.lang.String item,
@NotNull
java.util.List<? extends au.com.dius.pact.core.model.matchingrules.MatchingRule> rules)
Adds all the rules to the given key
public void applyMatcherRootPrefix(@NotNull
java.lang.String prefix)
Re-key all the rules with the given prefix
@NotNull public Category copyWithUpdatedMatcherRootPrefix(@NotNull java.lang.String prefix)
Create a copy of the category with all rules re-keyed with the prefix
@NotNull
public java.util.Map<java.lang.String,java.lang.Object> toMap(@NotNull
PactSpecVersion pactSpecVersion)
Serialise this category to a Map
public void fromMap(@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> map)
Deserialise the category from the Map
public int numRules(@NotNull
java.lang.String key)
Returns the number of rules stored at the key
@NotNull public java.lang.String getName()
@NotNull public java.util.Map<java.lang.String,au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup> getMatchingRules()
public void setMatchingRules(@NotNull
java.util.Map<java.lang.String,au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup> p)
@NotNull public java.lang.String component1()
@NotNull public java.util.Map<java.lang.String,au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup> component2()
@NotNull public Category copy(@NotNull java.lang.String name, @NotNull java.util.Map<java.lang.String,au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup> matchingRules)
Matching rules category
@NotNull public java.lang.String toString()
public int hashCode()
public boolean equals(@Nullable
java.lang.Object p)