Object ListUtilities.Companion

  • All Implemented Interfaces:

    
    public class ListUtilities.Companion
    
                        

    Cleanup helpers for the list-valued properties, which arrive as delimited strings.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • encapsulateListElements

         final String encapsulateListElements(List<String> listToEncapsulate)

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

        Returns a concatenated String with all elements of the passed list encapsulated.

      • readStringList

         final List<String> readStringList()

        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.

        Returns the list of values entered by the user.

      • cleanList

         final List<String> cleanList(List<String> listToCleanUp)

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

        listToCleanUp — The list from which to delete all entries consisting only of whitespace or with a length of zero. Returns returns the cleaned up list.

      • printListToLogChunked

         final Unit printListToLogChunked(List<String> list, Integer chunkSize, String prefix, Boolean printIndexes)

        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.