https://github.com/atrox/haikunatorjava
Generate Heroku-like random names to use in your Java applications
https://github.com/atrox/haikunatorjava
haikunator heroku java
Last synced: 9 months ago
JSON representation
Generate Heroku-like random names to use in your Java applications
- Host: GitHub
- URL: https://github.com/atrox/haikunatorjava
- Owner: Atrox
- License: mit
- Created: 2015-04-17T13:14:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-03T12:58:00.000Z (about 3 years ago)
- Last Synced: 2024-04-16T02:15:59.959Z (about 2 years ago)
- Topics: haikunator, heroku, java
- Language: Java
- Size: 44.9 KB
- Stars: 30
- Watchers: 3
- Forks: 3
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HaikunatorJAVA
[](https://travis-ci.org/Atrox/haikunatorjava)
[](https://maven-badges.herokuapp.com/maven-central/me.atrox.haikunator/Haikunator)
[](https://coveralls.io/r/Atrox/haikunatorjava)
Generate Heroku-like random names to use in your java applications.
## Installation
To install Haikunator add the following to your maven configuration
```xml
me.atrox.haikunator
Haikunator
2.0.1
```
*For more examples how to add Haikunator to your project, [follow this link](https://maven-badges.herokuapp.com/maven-central/me.atrox.haikunator/Haikunator)*
## Usage
Haikunator is pretty simple.
```java
import me.atrox.haikunator;
// default usage
Haikunator haikunator = new Haikunator();
haikunator.haikunate() // => "wispy-dust-1337"
// custom length (default=4)
Haikunator haikunator = new Haikunator().setTokenLength(6);
haikunator.haikunate() // => "patient-king-887265"
// use hex instead of numbers
Haikunator haikunator = new Haikunator().setTokenHex(true);
haikunator.haikunate() // => "purple-breeze-98e1"
// use custom chars instead of numbers/hex
Haikunator haikunator = new Haikunator().setTokenChars("HAIKUNATE");
haikunator.haikunate() // => "summer-atom-IHEA"
// don't include a token
Haikunator haikunator = new Haikunator().setTokenLength(0);
haikunator.haikunate() // => "cold-wildflower"
// use a different delimiter
Haikunator haikunator = new Haikunator().setDelimiter(".");
haikunator.haikunate() // => "restless.sea.7976"
// no token, space delimiter
Haikunator haikunator = new Haikunator().setTokenLength(0).setDelimiter(" ");
haikunator.haikunate() // => "delicate haze"
// no token, empty delimiter
Haikunator haikunator = new Haikunator().setTokenLength(0).setDelimiter("");
haikunator.haikunate() // => "billowingleaf"
```
## Options
The following options are available:
```java
Haikunator haikunator = new Haikunator()
.setDelimiter("-")
.setTokenLength(4)
.setTokenHex(false)
.setTokenChars("0123456789")
.setAdjectives(new String[]{"..."})
.setNouns(new String[]{"..."})
.setRandom(new Random());
```
*If ```tokenHex``` is true, it overrides any tokens specified in ```tokenChars```*
## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- [Report bugs](https://github.com/Atrox/haikunatorjava/issues)
- Fix bugs and [submit pull requests](https://github.com/Atrox/haikunatorjava/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features
## Other Languages
Haikunator is also available in other languages. Check them out:
- Python: https://github.com/Atrox/haikunatorpy
- Node: https://github.com/Atrox/haikunatorjs
- PHP: https://github.com/Atrox/haikunatorphp
- .NET: https://github.com/Atrox/haikunator.net
- Go: https://github.com/Atrox/haikunatorgo
- Dart: https://github.com/Atrox/haikunatordart
- Ruby: https://github.com/usmanbashir/haikunator
- Rust: https://github.com/nishanths/rust-haikunator