Class ReportItemBuilder
Provides methods to construct a Report
Inherited Members
Namespace: Unity.ProjectAuditor .Editor.Core
Assembly: Unity.ProjectAuditor.Editor.dll
Syntax
public class ReportItemBuilder
Constructors
ReportItemBuilder(IssueCategory, string)
Constructor for an object to build ReportItems representing Insights.
Declaration
public ReportItemBuilder(IssueCategory category, string description)
Parameters
Type | Name | Description |
---|---|---|
Issue |
category | The IssueCategory of the reported Insight |
string | description | The primary descriptive string for this Insight |
ReportItemBuilder(IssueCategory, DescriptorId, params object[])
Constructor for an object to build ReportItems representing Issues.
Declaration
public ReportItemBuilder(IssueCategory category, DescriptorId id, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Issue |
category | The IssueCategory of the reported Issue |
Descriptor |
id | Identifies the Descriptor object containing information about the Issue |
object[] | args | Arguments to be used in the message formatting |
Methods
WithCustomProperties(int, object)
Initialize all custom properties to the same value.
Declaration
public ReportItemBuilder WithCustomProperties(int numProperties, object property)
Parameters
Type | Name | Description |
---|---|---|
int | numProperties | total number of custom properties |
object | property | value the properties will be set to |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the custom properties set. |
WithCustomProperties(object[])
Initialize custom properties.
Declaration
public ReportItemBuilder WithCustomProperties(object[] properties)
Parameters
Type | Name | Description |
---|---|---|
object[] | properties | Issue-specific properties |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the custom properties initialized. |
WithDependencies(DependencyNode)
Adds a DependencyNode to the ReportItem being built.
Declaration
public ReportItemBuilder WithDependencies(DependencyNode dependencies)
Parameters
Type | Name | Description |
---|---|---|
Dependency |
dependencies | The root DependencyNode of a dependency chain to add |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the DependencyNode added |
WithDescription(string)
Adds a description string to the ReportItem being built.
Declaration
public ReportItemBuilder WithDescription(string description)
Parameters
Type | Name | Description |
---|---|---|
string | description | Description string to add |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the description string added |
WithLocation(string, int)
Constructs a Location object and adds it to the ReportItem being built.
Declaration
public ReportItemBuilder WithLocation(string path, int line = 0)
Parameters
Type | Name | Description |
---|---|---|
string | path | File path within the project describing where the specific item was found |
int | line | A line number within the file |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the Location added |
WithLocation(Location)
Adds a Location to the ReportItem being built.
Declaration
public ReportItemBuilder WithLocation(Location location)
Parameters
Type | Name | Description |
---|---|---|
Location | location | Location object describing where the specific item was found within the project |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the Location added |
WithLogLevel(LogLevel)
Adds a LogLevel to the ReportItem being built.
Declaration
public ReportItemBuilder WithLogLevel(LogLevel logLevel)
Parameters
Type | Name | Description |
---|---|---|
Log |
logLevel | Log Level of the item |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the LogLevel added |
WithSeverity(Severity)
Adds a Severity to the ReportItem being built.
Declaration
public ReportItemBuilder WithSeverity(Severity severity)
Parameters
Type | Name | Description |
---|---|---|
Severity | severity | Severity of the item |
Returns
Type | Description |
---|---|
Report |
The ReportItemBuilder object with the LogLevel added |
Operators
implicit operator ReportItem(ReportItemBuilder)
Implicit conversion of ReportItemBuilder to ReportItem.
Declaration
public static implicit operator ReportItem(ReportItemBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
Report |
builder | A ReportItemBuilder to convert |
Returns
Type | Description |
---|---|
Report |
A ReportItem |