summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java
diff options
context:
space:
mode:
authorEVE <EVE@EVE-PC>2017-03-13 16:42:21 -0400
committerEVE <EVE@EVE-PC>2017-03-13 16:42:21 -0400
commit27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd (patch)
tree847fb52acb091c1c613d37b8477094d5762c6988 /BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java
parentaa807a96cae2c47259fb38f710640883060339e9 (diff)
Formatting
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java
index 9be6080..82a29a2 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/EnumUtils.java
@@ -17,18 +17,18 @@ public class EnumUtils {
* Do an action for a random number of enum values
*
* @param <E>
- * The type of the enum
+ * The type of the enum
* @param clasz
- * The enum class
+ * The enum class
* @param nValues
- * The number of values to execute the action on
+ * The number of values to execute the action on
* @param action
- * The action to perform on random values
+ * The action to perform on random values
* @param rnd
- * The source of randomness to use
+ * The source of randomness to use
*/
- public static <E extends Enum<E>> void doForValues(Class<E> clasz,
- int nValues, Consumer<E> action, Random rnd) {
+ public static <E extends Enum<E>> void doForValues(Class<E> clasz, int nValues, Consumer<E> action,
+ Random rnd) {
E[] enumValues = clasz.getEnumConstants();
IList<E> valueList = new FunctionalList<>(enumValues);
@@ -48,15 +48,14 @@ public class EnumUtils {
* Get a random value from an enum
*
* @param <E>
- * The type of the enum
+ * The type of the enum
* @param clasz
- * The class of the enum
+ * The class of the enum
* @param rnd
- * The random source to use
+ * The random source to use
* @return A random value from the specified enum
*/
- public static <E extends Enum<E>> E getRandomValue(Class<E> clasz,
- Random rnd) {
+ public static <E extends Enum<E>> E getRandomValue(Class<E> clasz, Random rnd) {
E[] enumValues = clasz.getEnumConstants();
return new FunctionalList<>(enumValues).randItem(rnd::nextInt);