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

io.javarig.generator.primitive.IntegerGenerator Maven / Gradle / Ivy

Go to download

This project aims to provide a random instances generator for any class in java, it iterates through setters of an empty object and sets the fields values (using Java reflection api) randomly

The newest version!
package io.javarig.generator.primitive;

import io.javarig.RandomInstanceGenerator;
import io.javarig.generator.TypeGenerator;

import java.lang.reflect.Type;

public class IntegerGenerator extends TypeGenerator {
    public IntegerGenerator(Type type, RandomInstanceGenerator randomInstanceGenerator) {
        super(type, randomInstanceGenerator);
    }

    @Override
    public Integer generate() {
        return getRandom().nextInt(Integer.MIN_VALUE, Integer.MAX_VALUE);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy