Object ServiceBase.Companion

    • Constructor Detail

    • Method Detail

      • collapseCommonPrefixes

         final <T extends Any> List<String> collapseCommonPrefixes(String queryPrefix, String delimiter, List<T> contents, Function1<T, String> function)

        Collapse all elements with keys starting with some prefix up to the given delimiter into one prefix entry. Collapsed elements are removed from the contents list.

        Parameters:
        queryPrefix - the key prefix as specified in the list request
        delimiter - the delimiter used to separate a prefix from the rest of the object name
        contents - the list of contents to use for collapsing the prefixes
        function - the function to apply on a content to extract the value to collapse the prefixes on