com.flextrade.jfixture.builders.UuidGenerator 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.builders;
import com.flextrade.jfixture.NoSpecimen;
import com.flextrade.jfixture.SpecimenBuilder;
import com.flextrade.jfixture.SpecimenContext;
import java.util.UUID;
class UuidGenerator implements SpecimenBuilder {
@Override
public Object create(Object request, SpecimenContext context) {
if (!request.equals(UUID.class)) {
return new NoSpecimen();
}
return UUID.randomUUID();
}
}