Class RenderingUtils


  • public class RenderingUtils
    extends Object
    Generic utilities for page rendering.
    • Constructor Detail

      • RenderingUtils

        public RenderingUtils()
    • Method Detail

      • convertNanosecondsToTimeString

        public static String convertNanosecondsToTimeString​(long nanoseconds)
        Convert nanoseconds to a human-readable time string.
        Parameters:
        nanoseconds - The amount of nanoseconds.
        Returns:
        The human-readable string representation.
      • convertNanosecondsToMilliseconds

        public static long convertNanosecondsToMilliseconds​(long nanoseconds)
        Convert nanoseconds to milliseconds.
        Parameters:
        nanoseconds - The amount of nanoseconds.
        Returns:
        The millisecond representation.
      • getPluginVersion

        public static String getPluginVersion()
        Return the current Cluecumber version.
        Returns:
        The version string.
      • escapeHTML

        public static String escapeHTML​(String sourceString)
        Escape HTML tags in a string.
        Parameters:
        sourceString - The source string.
        Returns:
        The escaped string.
      • turnUrlsIntoLinks

        public static String turnUrlsIntoLinks​(String sourceString)
        Return the source html string with added tags so URLs are clickable.
        Parameters:
        sourceString - The source string.
        Returns:
        The string with additional anchor tags.
      • convertTimestampToZonedDateTime

        public static ZonedDateTime convertTimestampToZonedDateTime​(String timestampString)
        Return a ZonedDateTime from a timestamp string.
        Parameters:
        timestampString - the timestamp string.
        Returns:
        the converted ZonedDateTime.
      • convertZonedDateTimeToDateString

        public static String convertZonedDateTimeToDateString​(ZonedDateTime startDateTime)
        Convert a time zone date time to a human-readable year, month and day string.
        Parameters:
        startDateTime - The ZonedDateTime instance.
        Returns:
        The string representation.
      • convertZonedDateTimeToTimeString

        public static String convertZonedDateTimeToTimeString​(ZonedDateTime startDateTime)
        Convert a time zone date time to a human-readable hour, minute and second string.
        Parameters:
        startDateTime - The ZonedDateTime instance.
        Returns:
        The string representation.
      • isUrl

        public static boolean isUrl​(String value)
        Check if a string is a URL.
        Parameters:
        value - The string to check.
        Returns:
        true if it is a URL.
      • isRelativeUrl

        public static boolean isRelativeUrl​(String value)
        Check if a string is a relative URL.
        Parameters:
        value - The string to check.
        Returns:
        true if it is a relative URL.