All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.flextrade.jfixture.builders.StringGenerator Maven / Gradle / Ivy

Go to download

JFixture is an open source library based on the popular .NET library, AutoFixture

The newest version!
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 StringGenerator implements SpecimenBuilder {

    @Override
    public Object create(Object request, SpecimenContext context) {
       if (!request.equals(String.class)) {
            return new NoSpecimen();
       }

        return UUID.randomUUID().toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy