Skip to content

murdos/easy-random-protobuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easy-random-protobuf

Apache2 license Build Status Maven Central Javadocs

Extension for Easy Random library adding support for Protocol buffers.

Maven

<dependency>
    <groupId>io.github.murdos</groupId>
    <artifactId>easy-random-protobuf</artifactId>
    <version>0.4.0</version>
</dependency>

Usage

This library declares a SPI provider, so Easy Random will detect it automatically.

If you want to explicitly use it:

EasyRandomParameters parameters = new EasyRandomParameters()
        .randomizerRegistry(new ProtobufRandomizerRegistry());

EasyRandom easyRandom = new EasyRandom(parameters);

Person randomPerson = easyRandom.nextObject(Person.class); // With Person being a generated class from a .proto file

Building

$ git clone https://github.com/murdos/easy-random-protobuf.git
$ cd easy-random-protobuf
$ mvn clean install