com.flextrade.jfixture.requests.enrichers.FromListRequestEnricher 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 com.flextrade.jfixture.annotations.FromListOf;
import com.flextrade.jfixture.exceptions.ObjectCreationException;
import com.flextrade.jfixture.requests.ElementFromListRequest;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
public class FromListRequestEnricher implements RequestEnricher {
private final StringListBuilder stringListBuilder = new StringListBuilder();
private final NumberListBuilder numberListBuilder = new NumberListBuilder();
@Override
public Object enrich(Object request, Annotation annotation) {
if (!(annotation instanceof FromListOf)) {
return null;
}
if (!(request instanceof Type)) {
return null;
}
FromListOf fromList = (FromListOf) annotation;
Type requestType = (Type) request;
validateAnnotation(fromList);
List