Skip to content

kdebski85/jfairy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jFairy by Devskiller

Build Status Maven Central Javadocs Coverage Status Stack Overflow Join the chat at https://gitter.im/Codearte/jfairy

Java fake data generator. Based on Wikipedia:

Fairyland, in folklore, is the fabulous land or abode of fairies or fays.

Try jFairy online!

https://devskiller.com/datafairy/

Usage

Creating simple objects:

Fairy fairy = Fairy.create();
Person person = fairy.person();

System.out.println(person.getFirstName());            
// Chloe Barker
System.out.println(person.getEmail());               
// [email protected]
System.out.println(person.getTelephoneNumber());     
// 690-950-802

Person adultMale = fairy.person(PersonProperties.male(), PersonProperties.minAge(21));
System.out.println(adultMale.isMale());           
// true
System.out.println(adultMale.getDateOfBirth());      
// at least 21 years earlier

Creating related objects:

Fairy fairy = Fairy.create();
Company company = fairy.company();
System.out.println(company.getName());          
// Robuten Associates
System.out.println(company.getUrl());           
// http://www.robuteniaassociates.com

Person salesman = fairy.person(PersonProperties.withCompany(company));
System.out.println(salesman.getFullName());     
// Juan Camacho
System.out.println(salesman.getCompanyEmail()); 
// [email protected]

Locale support:

Fairy enFairy = Fairy.create();                               
// Locale.ENGLISH is default
Fairy plFairy = Fairy.create(Locale.forLanguageTag("pl"));    
// Polish version

Other samples

Look into code samples

Building

This project can be built using maven command:

./mvnw install

Packages

No packages published

Languages

  • Java 67.1%
  • Groovy 32.9%