/**
 * Copyright (c) 2016, German Neuroinformatics Node (G-Node)
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted under the terms of the BSD License. See
 * LICENSE file in the root of the Project.
 */

package org.g_node.micro.commons;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
import org.apache.commons.codec.digest.DigestUtils;

/**
 * Class providing utility methods to g-node microservice applications.
 *
 * @author Michael Sonntag (sonntag@bio.lmu.de)
 */
public final class AppUtils {

    /**
     * Return time stamp formatted corresponding to input format pattern.
     * @param format Input format pattern.
     * @return Formatted timestamp.
     */
    public static String getTimeStamp(final String format) {
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern(format));
    }

    /**
     * Method converts a List of Strings to upper case, joins the individual entries by a blank space
     * and retrieves a hexadecimal String from the resulting input String using the SHA-1 hash algorithm.
     * @param valueList List of Strings.
     * @return Hexadecimal String of the SHA-1 encoded input Strings.
     */
    public static String getHashSHA(final List<String> valueList) {
        final String collectListValues = valueList.stream()
                .map(s -> s.toUpperCase(Locale.ENGLISH))
                .collect(Collectors.joining(" "));

        return DigestUtils.shaHex(collectListValues);
    }

}

@@ -749,30 +749,45 @@
 ng to input 
-format
+dateTimeFormatPattern
  pattern.%0A  
@@ -802,35 +802,152 @@
 ram 
-format Input format pattern
+dateTimeFormatPattern Input dateTimeFormatPattern pattern.%0A     *                              Use %7B@link DateTimeFormatter%7D pattern conventions
 .%0A  
@@ -1039,22 +1039,37 @@
  String 
-format
+dateTimeFormatPattern
 ) %7B%0A    
@@ -1134,22 +1134,37 @@
 Pattern(
-format
+dateTimeFormatPattern
 ));%0A    

Refactor getTimeStamp dateTimePattern