ListUtilities

Utility-class revolving around Lists.

Author

Griefed

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Clean a given String List of any entry consisting only of whitespace or a length of 0 .

Link copied to clipboard
fun encapsulateListElements(listToEncapsulate: List<String>): String

Encapsulate every element of the passed String List in quotes. Returns the list as ["element1","element2","element3" etc.

Link copied to clipboard
fun printListToConsoleChunked(list: List<String>, chunkSize: Int, prefix: String, printIndexes: Boolean)

Print a list to console in chunks. If a chunk size of 5 is set for a list with 20 entries, the result would be 4 lines printed, with 5 entries each.

Link copied to clipboard
fun printListToLogChunked(list: List<String>, chunkSize: Int, prefix: String, printIndexes: Boolean)

Print a list to our log at info level, in chunks. If a chunk size of 5 is set for a list with 20 entries, the result would be 4 lines printed, with 5 entries each.

Link copied to clipboard

Prompts the user to enter the values which will make up a String List in the new configuration file. If the user enters an empty line, the method is exited and the String List returned.