Skip to content
This repository was archived by the owner on Feb 14, 2021. It is now read-only.

Repository files navigation

uinames for Java

This is a library to generate random localized names consuming the API of uinames as source.

Installation

Download the JAR file and its dependencies (see below) and import them to your project.

Dependencies

At the time this library was written, this was the dependencies used to work with it.

Using uinames-java

First of all import the library classes into your project:

importname.davidsanchez.uiname.*;

Then create an instance of the UIName class:

UINameuiName = newUIName();

This way, you will use the default parameters. You can modify parameters this way:

UINameuiName = newUIName()
.setAmount(2) // Amount of names you want to generate
.setGender(Constants.Gender.FEMALE) // Gender of the names you want to generate
.setCountry(Constants.Country.COLOMBIA); // Localization of the names you want to generate

Then, you can use the generateNames() method, it will ask you to implement the UINameResponse interface:

uiName.generateNames(newUINameResponse() {
@OverridepublicvoidonNamesReceived(Person[] people) {
// The parameter people have all the generated people names in their // corresponding class.for (Personperson : people) {
System.out.println("Name: " + p.getName() + "\nSurname: " + p.getSurname() +
"\nCountry: " + p.getCountry() +
"\nGender: " + p.getGender());
}
}
});

About

Java library to consume uinames API

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages