Package net.obvj.performetrics.config
Class Configuration
- java.lang.Object
-
- net.obvj.performetrics.config.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 Summary
Constructors Constructor Description Configuration()Builds a newConfigurationwith all initial values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConversionModegetConversionMode()Returns the conversion mode applied in supported operations if no specific mode is set.PrintStylegetPrintStyle()Returns the defaultPrintStyleto be applied when no style is specified.PrintStylegetPrintStyleForDetails()Returns the defaultPrintStylefor the detailed stopwatch formatter.PrintStylegetPrintStyleForSummary()Returns the defaultPrintStylefor the summarized stopwatch formatter.intgetScale()Returns the maximum number of decimal places applied if double-precision conversion mode is set.voidsetConversionMode(ConversionMode conversionMode)Defines the default conversion mode to be applied in supported operations if no specific mode is set.voidsetPrintStyle(PrintStyle printStyle)Defines the defaultPrintStyleto be applied when no style is specified.voidsetPrintStyleForDetails(PrintStyle printStyle)Defines the defaultPrintStylefor the detailed stopwatch formatter.voidsetPrintStyleForSummary(PrintStyle printStyle)Defines the defaultPrintStylefor the summarized stopwatch formatter.voidsetScale(int scale)Sets a maximum number of decimal places to be applied if double-precision conversion mode is set.
-
-
-
Method Detail
-
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- theConversionModeto 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 defaultPrintStyleto be applied when no style is specified.- Returns:
- the default
PrintStyleto be applied when no style is specified - Since:
- 2.4.0
-
setPrintStyle
public void setPrintStyle(PrintStyle printStyle)
Defines the defaultPrintStyleto be applied when no style is specified.The object will be applied by the following operations:
- Parameters:
printStyle- thePrintStyleto be set; not null- Throws:
NullPointerException- if the specifiedPrintStyleis null- Since:
- 2.4.0
-
getPrintStyleForSummary
public PrintStyle getPrintStyleForSummary()
Returns the defaultPrintStylefor the summarized stopwatch formatter.- Returns:
- the default
PrintStylefor the summarized stopwatch formatter - Since:
- 2.2.1
-
setPrintStyleForSummary
public void setPrintStyleForSummary(PrintStyle printStyle)
Defines the defaultPrintStylefor the summarized stopwatch formatter.The object will be used by the following operation:
- Parameters:
printStyle- thePrintStyleto be set; not null- Throws:
NullPointerException- if the specifiedPrintStyleis null- Since:
- 2.2.1
-
getPrintStyleForDetails
public PrintStyle getPrintStyleForDetails()
Returns the defaultPrintStylefor the detailed stopwatch formatter.- Returns:
- the default
PrintStylefor the detailed stopwatch formatter - Since:
- 2.2.1
-
setPrintStyleForDetails
public void setPrintStyleForDetails(PrintStyle printStyle)
Defines the defaultPrintStylefor the detailed stopwatch formatter.The object will be used by the following operations:
- Parameters:
printStyle- thePrintStyleto be set; not null- Throws:
NullPointerException- if the specifiedPrintStyleis null- Since:
- 2.2.1
-
-