Class Configuration


  • public class Configuration
    extends Object
    An object that maintains common configurable parameters for Perfometrics objects.
    Since:
    2.0.0
    Author:
    oswaldo.bapvic.jr
    • Constructor Detail

      • Configuration

        public Configuration()
        Builds a new Configuration with all initial values.
    • Method Detail

      • getTimeUnit

        public TimeUnit getTimeUnit()
        Returns the time unit maintained by default if no specific time unit is specified.
        Returns:
        the time unit maintained by default
      • setTimeUnit

        public void setTimeUnit​(TimeUnit timeUnit)
        Defines the time unit to be maintained by default if no specific time unit is specified.
        Parameters:
        timeUnit - the TimeUnit to set
        Throws:
        NullPointerException - if the specified time unit is null
      • getConversionMode

        public ConversionMode getConversionMode()
        Returns the conversion mode applied in supported operations if no specific mode is set.
        Returns:
        the conversion mode applied in supported operations
      • setConversionMode

        public void setConversionMode​(ConversionMode conversionMode)
        Defines the default conversion mode to be applied in supported operations if no specific mode is set.
        Parameters:
        conversionMode - the ConversionMode to set
        Throws:
        NullPointerException - if the specified conversion mode is null
      • getScale

        public int getScale()
        Returns the maximum number of decimal places applied if double-precision conversion mode is set.
        Returns:
        the the maximum number of decimal places applied
      • setScale

        public void setScale​(int scale)
        Sets a maximum number of decimal places to be applied if double-precision conversion mode is set.
        Parameters:
        scale - a number between 0 and 16 to be set
        Throws:
        IllegalArgumentException - if the specified number is outside the allowed range
      • getPrintStyle

        public PrintStyle getPrintStyle()
        Returns the default PrintStyle to be applied when no style is specified.
        Returns:
        the default PrintStyle to be applied when no style is specified
        Since:
        2.4.0
      • getPrintStyleForSummary

        public PrintStyle getPrintStyleForSummary()
        Returns the default PrintStyle for the summarized stopwatch formatter.
        Returns:
        the default PrintStyle for the summarized stopwatch formatter
        Since:
        2.2.1
      • getPrintStyleForDetails

        public PrintStyle getPrintStyleForDetails()
        Returns the default PrintStyle for the detailed stopwatch formatter.
        Returns:
        the default PrintStyle for the detailed stopwatch formatter
        Since:
        2.2.1