Coder Social home page Coder Social logo

uinames-java's Introduction

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:

import name.davidsanchez.uiname.*;

Then create an instance of the UIName class:

UIName uiName = new UIName();

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

UIName uiName = new UIName()
    .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(new UINameResponse() {
    @Override
    public void onNamesReceived(Person[] people) {
		// The parameter people have all the generated people names in their 
		// corresponding class.
        for (Person person : people) {
        	System.out.println("Name: " + p.getName() + 
                "\nSurname: " + p.getSurname() +
                "\nCountry: " + p.getCountry() +
                "\nGender: " + p.getGender());
        }
    }
});

uinames-java's People

Contributors

juanda95 avatar

Stargazers

Jordan avatar Thanesh Rajandran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.