diff --git a/build.gradle b/build.gradle index d0beab8..a7eda30 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ repositories { group = 'com.oblac' -version = '2.2.0' +version = '2.2.1' java { sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/src/main/java/com/oblac/nomen/Nomen.java b/src/main/java/com/oblac/nomen/Nomen.java index b9f52ca..b1a2900 100644 --- a/src/main/java/com/oblac/nomen/Nomen.java +++ b/src/main/java/com/oblac/nomen/Nomen.java @@ -23,14 +23,14 @@ public class Nomen { protected LinkedList> template = new LinkedList<>(); - protected final Supplier ADJECTIVES = () -> randomValueFrom(rnd, Adjectives.LIST); - protected final Supplier ANIMALS = () -> randomValueFrom(rnd, Animals.LIST); - protected final Supplier COLORS = () -> randomValueFrom(rnd, Colors.LIST); - protected final Supplier NOUNS = () -> randomValueFrom(rnd, Nouns.LIST); - protected final Supplier PEOPLE = () -> randomValueFrom(rnd, People.LIST); - protected final Supplier POKEMON = () -> randomValueFrom(rnd, Pokemon.LIST); - protected final Supplier SUPERB = () -> randomValueFrom(rnd, Superb.LIST); - protected final Supplier SUPERHERO = () -> randomValueFrom(rnd, Superheroes.LIST); + protected final Supplier ADJECTIVES = () -> randomValueFrom(Adjectives.LIST); + protected final Supplier ANIMALS = () -> randomValueFrom(Animals.LIST); + protected final Supplier COLORS = () -> randomValueFrom(Colors.LIST); + protected final Supplier NOUNS = () -> randomValueFrom(Nouns.LIST); + protected final Supplier PEOPLE = () -> randomValueFrom(People.LIST); + protected final Supplier POKEMON = () -> randomValueFrom(Pokemon.LIST); + protected final Supplier SUPERB = () -> randomValueFrom(Superb.LIST); + protected final Supplier SUPERHERO = () -> randomValueFrom(Superheroes.LIST); protected String space = "-"; protected String separator = "_"; @@ -60,11 +60,11 @@ public Nomen literal(final String literal) { } public Nomen random(final List strings) { - template.add(() -> randomValueFrom(rnd, strings)); + template.add(() -> randomValueFrom(strings)); return this; } public Nomen random(final String... strings) { - template.add(() -> randomValueFrom(rnd, strings)); + template.add(() -> randomValueFrom(strings)); return this; } @@ -243,16 +243,16 @@ private static String replace(String s, String sub, String with) { * @param list array of strings * @return random string from given array */ - private String randomValueFrom(Random rnd, String... list) { + private String randomValueFrom(String... list) { final int index = rnd.nextInt(list.length); return list[index]; } - private String randomValueFrom(Random rnd, List list) { + private String randomValueFrom(List list) { final int index = rnd.nextInt(list.size()); return list.get(index); } - private static Random rnd = new Random(); + private Random rnd = new Random(); } \ No newline at end of file