Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.57 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.57 KB

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