Class FormattingUtils


  • public class FormattingUtils
    extends java.lang.Object
    Helper methods related to data formatting.
    • Constructor Summary

      Constructors 
      Constructor Description
      FormattingUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formattedDuration​(long durationSeconds)
      Converts the given duration in seconds to a more readable string representation: for example "2 days 1 minute 4 seconds".
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FormattingUtils

        public FormattingUtils()
    • Method Detail

      • formattedDuration

        public static java.lang.String formattedDuration​(long durationSeconds)
        Converts the given duration in seconds to a more readable string representation: for example "2 days 1 minute 4 seconds". This method doesn't generates weeks, months or years, only days which is expected to be sufficient for printing total time taken by even a long test run.
        Parameters:
        durationSeconds - the seconds to convert to human-readable form
        Returns:
        formatted representation, i.e. "1 hour 53 seconds"