extra readme

This commit is contained in:
Sander Hautvast 2020-01-14 22:19:25 +01:00
parent dadc6c6610
commit 578d3983e2

View file

@ -21,7 +21,7 @@ class Person{
``` ```
Factory.define(Person.class, () -> new Person("John", 48)); Factory.define(Person.class, () -> new Person("John", 48));
``` ```
* Create instances like so: * Then create instances like so:
``` ```
Person person = Factory.build(Person.class) Person person = Factory.build(Person.class)
``` ```
@ -31,8 +31,15 @@ Person person = Factory.build(Person.class)
Person person = Factory.build(Person.class, p -> p.setAge(25)); Person person = Factory.build(Person.class, p -> p.setAge(25));
``` ```
This will result in an object This will result in an object
```json ```
{name: "John", age: 25} {name: "John", age: 25}
``` ```
Meaning the template can be customized later on Meaning the template can be customized later on
_More features_
* Factory can also create more complex (nested) objects
* random numbers
* counters
* etc see FactoryTests.java