<commit_before>#FactoryDuke 

[![Build Status](https://travis-ci.org/regis-leray/factory_duke.png?branch=master)](https://travis-ci.org/regis-leray/factory_duke)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.regis-leray/factory-duke.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.github.regis-leray/factory-duke)
[![Coverage Status](https://coveralls.io/repos/github/regis-leray/factory_duke/badge.svg?branch=master)](https://coveralls.io/github/regis-leray/factory_duke?branch=master)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat)](http://vtence.mit-license.org)


FactoryDuke is a java framework that lets you create objects as test data. All you have to do is define the templates for each of the classes that you want FactoryDuke to create objects from. After that, FactoryDuke takes care of the rest.

Have you ever heard of factory_girl a super cool Ruby framework? Well, FactoryDuke is pretty similar in its use.

Factory Duke is using a lot of lamdba, so it is only compatible with ```java 8``` and higher.

###Concept 

* Simple 
* Extensible
* Fast (no reflection)
* Very light (Only one dependency)

###Installing

Use it like a maven dependency on your project

```
<dependency>
    <groupId>com.github.regis-leray</groupId>
    <artifactId>factory-duke</artifactId>
    <version>0.5</version>
</dependency>
```

##How do we use this?

FactoryDuke is a singleton object where you can register all of the templates. For example, you can define a template as follows:

````java
FactoryDuke.define(User.class, u -> {
			u.setLastName("Scott");
			u.setName("Malcom");<commit_msg>doc(README) : Update version<commit_after>#FactoryDuke 

[![Build Status](https://travis-ci.org/regis-leray/factory_duke.png?branch=master)](https://travis-ci.org/regis-leray/factory_duke)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.regis-leray/factory-duke.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.github.regis-leray/factory-duke)
[![Coverage Status](https://coveralls.io/repos/github/regis-leray/factory_duke/badge.svg?branch=master)](https://coveralls.io/github/regis-leray/factory_duke?branch=master)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat)](http://vtence.mit-license.org)


FactoryDuke is a java framework that lets you create objects as test data. All you have to do is define the templates for each of the classes that you want FactoryDuke to create objects from. After that, FactoryDuke takes care of the rest.

Have you ever heard of factory_girl a super cool Ruby framework? Well, FactoryDuke is pretty similar in its use.

Factory Duke is using a lot of lamdba, so it is only compatible with ```java 8``` and higher.

###Concept 

* Simple 
* Extensible
* Fast (no reflection)
* Very light (Only one dependency)

###Installing

Use it like a maven dependency on your project

```
<dependency>
    <groupId>com.github.regis-leray</groupId>
    <artifactId>factory-duke</artifactId>
    <version>0.6</version>
</dependency>
```

##How do we use this?

FactoryDuke is a singleton object where you can register all of the templates. For example, you can define a template as follows:

````java
FactoryDuke.define(User.class, u -> {
			u.setLastName("Scott");
			u.setName("Malcom");
{'fraction_non_alphanumeric': 0.13323308270676693, 'fraction_numerical': 0.0018045112781954887, 'mean_word_length': 4.918149466192171, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '994765', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1063, 'n_words': 293}