Class ReportBuilder


  • public class ReportBuilder
    extends Object
    A builder to create Report objects.
    Author:
    Florian Dupuy
    • Constructor Detail

      • ReportBuilder

        public ReportBuilder()
    • Method Detail

      • build

        public Report build()
        Build the corresponding Report.
        Returns:
        the new Report corresponding to current ReportBuilder
      • withKey

        public ReportBuilder withKey​(String reportKey)
        Provide the key to build the Report with.
        Parameters:
        reportKey - the key identifying the report to build
        Returns:
        a reference to this object
      • withDefaultMessage

        public ReportBuilder withDefaultMessage​(String defaultMessage)
        Provide the default message to build the Report with.
        Parameters:
        defaultMessage - the default report message of the report to build, which may contain references to its values or to the values of corresponding Reporter.
        Returns:
        a reference to this object
      • withTypedValue

        public ReportBuilder withTypedValue​(String key,
                                            String value,
                                            String type)
        Provide one typed string value to build the Report with.
        Parameters:
        key - the key for the typed string value
        value - the string value
        type - the string representing the type of the string value provided (see TypedValue constants for some generic types)
        Returns:
        a reference to this object
      • withValue

        public ReportBuilder withValue​(String key,
                                       String value)
        Provide one string value to build the Report with.
        Parameters:
        key - the key for the string value
        value - the string value
        Returns:
        a reference to this object
      • withTypedValue

        public ReportBuilder withTypedValue​(String key,
                                            double value,
                                            String type)
        Provide one typed double value to build the Report with.
        Parameters:
        key - the key for the typed double value
        value - the double value
        type - the string representing the type of the double value provided (see TypedValue constants for some generic types)
        Returns:
        a reference to this object
      • withValue

        public ReportBuilder withValue​(String key,
                                       double value)
        Provide one double value to build the Report with.
        Parameters:
        key - the key for the double value
        value - the double value
        Returns:
        a reference to this object
      • withTypedValue

        public ReportBuilder withTypedValue​(String key,
                                            float value,
                                            String type)
        Provide one typed float value to build the Report with.
        Parameters:
        key - the key for the typed float value
        value - the float value
        type - the string representing the type of the float value provided (see TypedValue constants for some generic types)
        Returns:
        a reference to this object
      • withValue

        public ReportBuilder withValue​(String key,
                                       float value)
        Provide one float value to build the Report with.
        Parameters:
        key - the key for the float value
        value - the float value
        Returns:
        a reference to this object
      • withTypedValue

        public ReportBuilder withTypedValue​(String key,
                                            int value,
                                            String type)
        Provide one typed int value to build the Report with.
        Parameters:
        key - the key for the typed int value
        value - the int value
        type - the string representing the type of the int value provided (see TypedValue constants for some generic types)
        Returns:
        a reference to this object
      • withValue

        public ReportBuilder withValue​(String key,
                                       int value)
        Provide one int value to build the Report with.
        Parameters:
        key - the key for the int value
        value - the int value
        Returns:
        a reference to this object
      • withTypedValue

        public ReportBuilder withTypedValue​(String key,
                                            long value,
                                            String type)
        Provide one typed long value to build the Report with.
        Parameters:
        key - the key for the typed long value
        value - the long value
        type - the string representing the type of the long value provided (see TypedValue constants for some generic types)
        Returns:
        a reference to this object
      • withValue

        public ReportBuilder withValue​(String key,
                                       long value)
        Provide one long value to build the Report with.
        Parameters:
        key - the key for the long value
        value - the long value
        Returns:
        a reference to this object
      • withTypedValue

        public ReportBuilder withTypedValue​(String key,
                                            boolean value,
                                            String type)
        Provide one typed boolean value to build the Report with.
        Parameters:
        key - the key for the typed boolean value
        value - the boolean value
        type - the string representing the type of the boolean value provided (see TypedValue constants for some generic types)
        Returns:
        a reference to this object
      • withValue

        public ReportBuilder withValue​(String key,
                                       boolean value)
        Provide one boolean value to build the Report with.
        Parameters:
        key - the key for the boolean value
        value - the boolean value
        Returns:
        a reference to this object
      • withSeverity

        public ReportBuilder withSeverity​(TypedValue severity)
        Provide the typed value for the default severity key to build the Report with.
        Parameters:
        severity - the typed value
        Returns:
        a reference to this object