com.flextrade.jfixture.requests.enrichers.CompositeRequestEnricher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfixture Show documentation
Show all versions of jfixture Show documentation
JFixture is an open source library based on the popular .NET library, AutoFixture
package com.flextrade.jfixture.requests.enrichers;
import java.lang.annotation.Annotation;
public class CompositeRequestEnricher implements RequestEnricher {
private final RequestEnricher[] enrichers;
public CompositeRequestEnricher(RequestEnricher... enrichers) {
this.enrichers = enrichers;
}
@Override
public Object enrich(Object request, Annotation annotation) {
for( RequestEnricher enricher : this.enrichers) {
Object newRequest = enricher.enrich(request, annotation);
if(newRequest != null) {
return newRequest;
}
}
return null;
}
}