public class FilteredPact<I extends Interaction> implements Pact<I>
| Constructor and Description |
|---|
FilteredPact(Pact<I> pact,
java.util.function.Predicate<I> interactionPredicate) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
compatibleTo(Pact<I> other)
If this pact is compatible with the other pact. Pacts are compatible if they have the
same provider and they are the same type
|
Pact<I> |
filterInteractions(java.util.function.Predicate<I> predicate)
Deprecated.
|
Consumer |
getConsumer()
Returns the consumer of the service for the pact
|
java.util.List<I> |
getInteractions()
Returns all the interactions of the pact
|
Pact<I> |
getPact() |
Provider |
getProvider()
Returns the provider of the service for the pact
|
PactSource |
getSource()
The source that this pact was loaded from
|
boolean |
isFiltered() |
boolean |
isNotFiltered() |
void |
mergeInteractions(java.util.List<? extends I> interactions)
Merges all the interactions into this Pact
|
Pact<I> |
sortInteractions()
Returns a pact with the interactions sorted
|
java.util.Map<java.lang.String,?> |
toMap(PactSpecVersion pactSpecVersion)
Returns a Map representation of this pact for the purpose of generating a JSON document.
|
java.lang.String |
toString() |
compatibleTo, filterInteractions, getConsumer, getInteractions, getProvider, getSource, mergeInteractions, sortInteractions, toMappublic FilteredPact(Pact<I> pact, java.util.function.Predicate<I> interactionPredicate)
public java.util.List<I> getInteractions()
Returns all the interactions of the pact
public boolean isNotFiltered()
public boolean isFiltered()
public java.lang.String toString()
public Pact<I> getPact()
public Consumer getConsumer()
Returns the consumer of the service for the pact
public Provider getProvider()
Returns the provider of the service for the pact
public PactSource getSource()
The source that this pact was loaded from
public boolean compatibleTo(Pact<I> other)
If this pact is compatible with the other pact. Pacts are compatible if they have the same provider and they are the same type
public Pact<I> filterInteractions(java.util.function.Predicate<I> predicate)
Returns a new Pact with all the interactions filtered by the provided predicate
public void mergeInteractions(java.util.List<? extends I> interactions)
Merges all the interactions into this Pact
interactions - public Pact<I> sortInteractions()
Returns a pact with the interactions sorted
public java.util.Map<java.lang.String,?> toMap(PactSpecVersion pactSpecVersion)
Returns a Map representation of this pact for the purpose of generating a JSON document.