public class Report extends Object implements Iterable<Issue>, Serializable
issues: it contains no duplicate elements, i.e. it models the
mathematical set abstraction. This report provides a total ordering on its elements. I.e., the issues
in this report are ordered by their index: the first added issue is at position 0, the second added issues is at
position 1, and so on.
Additionally, this report provides methods to find and filter issues based on different properties. In order to
create issues use the provided builder class.
| Modifier and Type | Class and Description |
|---|---|
static class |
Report.IssueFilterBuilder
Builds a combined filter based on several include and exclude filters.
|
| Constructor and Description |
|---|
Report()
Creates an empty
Report. |
Report(Collection<Report> reports)
|
Report(Report... reports)
|
| Modifier and Type | Method and Description |
|---|---|
Report |
add(Issue issue)
Appends the specified issue to the end of this report.
|
Report |
addAll(Collection<? extends Issue> issues)
Appends all of the specified issues to the end of this report, preserving the order of the array elements.
|
Report |
addAll(Issue issue,
Issue... additionalIssues)
Appends all of the specified issues to the end of this report, preserving the order of the array elements.
|
Report |
addAll(Report... reports)
Appends the specified
reports to this report. |
Report |
copy()
Returns a shallow copy of this issue container.
|
Report |
copyEmptyInstance()
Returns a new empty issue container with the same properties as this container.
|
boolean |
equals(Object o) |
Report |
filter(Predicate<? super Issue> criterion)
Finds all issues that match the specified criterion.
|
Issue |
findById(UUID issueId)
Returns the issue with the specified ID.
|
Set<Issue> |
findByProperty(Predicate<? super Issue> criterion)
Finds all issues that match the specified criterion.
|
Issue |
get(int index)
Returns the issue with the specified index.
|
Set<String> |
getCategories()
Returns the used categories for all issues.
|
int |
getDuplicatesSize()
Returns the number of duplicates.
|
org.eclipse.collections.api.list.ImmutableList<String> |
getErrorMessages()
Returns the error messages that have been reported since the creation of this set of issues.
|
Set<String> |
getFiles()
Returns the affected files for all issues.
|
org.eclipse.collections.api.list.ImmutableList<String> |
getInfoMessages()
Returns the info messages that have been reported since the creation of this set of issues.
|
Set<String> |
getModules()
Returns the affected modules for all issues.
|
Set<String> |
getPackages()
Returns the affected packages for all issues.
|
<T> Set<T> |
getProperties(Function<? super Issue,T> propertiesMapper)
Returns the different values for a given property for all issues.
|
<T> Map<T,Integer> |
getPropertyCount(Function<? super Issue,T> propertiesMapper)
Returns the number of occurrences for every existing value of a given property for all issues.
|
Set<Severity> |
getSeverities()
Returns the severities of all issues.
|
int |
getSize()
Returns the number of issues in this report.
|
int |
getSizeOf(Severity severity)
Returns the number of issues with the specified
Severity. |
int |
getSizeOf(String severity)
Returns the number of issues with the specified
severity. |
Set<String> |
getTools()
Returns the names of the tools that did report the issues.
|
Set<String> |
getTypes()
Returns the used types for all issues.
|
Map<String,Report> |
groupByProperty(String propertyName)
Groups issues by a specified property.
|
boolean |
hasCategories()
Returns whether this report contains issues with different categories.
|
boolean |
hasErrors()
Returns whether error messages have been reported.
|
boolean |
hasFiles()
Returns whether this report contains more than one affected file.
|
int |
hashCode() |
boolean |
hasModules()
Returns whether this report contains affected files from more than one module.
|
boolean |
hasPackages()
Returns whether this report contains affected files from more than one package.
|
boolean |
hasSeverities()
Returns whether this report contains issues of different severities.
|
boolean |
hasTools()
Returns whether this report contains issues created by different tools.
|
boolean |
hasTypes()
Returns whether this report contains issues with different types.
|
boolean |
isEmpty()
Returns whether this report is empty.
|
boolean |
isNotEmpty()
Returns whether this report is not empty.
|
Iterator<Issue> |
iterator() |
void |
logError(String format,
Object... args)
Logs the specified error message.
|
void |
logException(Exception exception,
String format,
Object... args)
Logs the specified exception.
|
void |
logInfo(String format,
Object... args)
Logs the specified information message.
|
Issue |
remove(UUID issueId)
Removes the issue with the specified ID.
|
int |
size()
Returns the number of issues in this container.
|
Stream<Issue> |
stream()
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Report()
Report.public Report(Report... reports)
Report that is an aggregation of the specified reports. The created report
will contain the issues of all specified reports, in the same order. The properties of the specified reports will
also be copied.reports - the reports to appendcopyIssuesAndProperties(Report, Report)public Report(Collection<Report> reports)
Report that is an aggregation of the specified reports. The created report
will contain the issues of all specified reports, in the same order. The properties of the specified reports will
also be copied.reports - the initial set of issuescopyIssuesAndProperties(Report, Report)public Report add(Issue issue)
getDuplicatesSize().issue - the issue to appendpublic Report addAll(Issue issue, Issue... additionalIssues)
getDuplicatesSize().issue - the first issue to appendadditionalIssues - the additional issue to appendadd(Issue)public Report addAll(Collection<? extends Issue> issues)
getDuplicatesSize().issues - the issues to appendadd(Issue)public Report addAll(Report... reports)
reports to this report. This report will then contain the issues of all
specified reports, in the same order. The properties of the specified reports will also be copied.reports - the reports to appendcopyIssuesAndProperties(Report, Report)public Issue remove(UUID issueId)
issueId - the ID of the issueNoSuchElementException - if there is no such issue foundpublic Issue findById(UUID issueId)
issueId - the ID of the issueNoSuchElementException - if there is no such issue foundpublic Set<Issue> findByProperty(Predicate<? super Issue> criterion)
criterion - the filter criterionpublic Report filter(Predicate<? super Issue> criterion)
criterion - the filter criterionpublic int size()
public boolean isEmpty()
true if this report is empty, false otherwiseisNotEmpty()public boolean isNotEmpty()
true if this report is not empty, false otherwiseisEmpty()public int getSize()
public int getDuplicatesSize()
equals(Object)) is counted as a duplicate. Duplicates are not stored in this report.public int getSizeOf(String severity)
severity.severity - the severity of the issuespublic int getSizeOf(Severity severity)
Severity.severity - the severity of the issuespublic Issue get(int index)
index - the indexIndexOutOfBoundsException - if there is no element for the given indexpublic Set<String> getModules()
public boolean hasModules()
true if the number of modules is greater than 1, false otherwisepublic Set<String> getPackages()
public boolean hasPackages()
true if the number of packages is greater than 1, false otherwisepublic Set<String> getFiles()
public boolean hasFiles()
true if the number of affected files is greater than 1, false otherwisepublic Set<String> getCategories()
public boolean hasCategories()
true if the number of categories is greater than 1, false otherwisepublic Set<String> getTypes()
public boolean hasTypes()
true if the number of types is greater than 1, false otherwisepublic Set<String> getTools()
public boolean hasTools()
true if the number of tools is greater than 1, false otherwisepublic Set<Severity> getSeverities()
public boolean hasSeverities()
true if the number of severities is greater than 1, false otherwisepublic <T> Set<T> getProperties(Function<? super Issue,T> propertiesMapper)
T - type of the propertypropertiesMapper - the properties mapper that selects the propertygetFiles()public <T> Map<T,Integer> getPropertyCount(Function<? super Issue,T> propertiesMapper)
T - type of the propertypropertiesMapper - the properties mapper that selects the property to evaluategetProperties(Function)public Map<String,Report> groupByProperty(String propertyName)
Report for this value.propertyName - the property to that selects the property to evaluategetProperties(Function)public Report copy()
public Report copyEmptyInstance()
@FormatMethod public void logInfo(String format, Object... args)
format - A format stringargs - Arguments referenced by the format specifiers in the format string. If there are more arguments than
format specifiers, the extra arguments are ignored. The number of arguments is variable and may be
zero.getInfoMessages()@FormatMethod public void logError(String format, Object... args)
format - A format stringargs - Arguments referenced by the format specifiers in the format string. If there are more arguments than
format specifiers, the extra arguments are ignored. The number of arguments is variable and may be
zero.getInfoMessages()@FormatMethod public void logException(Exception exception, String format, Object... args)
exception - the exception to logformat - A format stringargs - Arguments referenced by the format specifiers in the format string. If there are more arguments than
format specifiers, the extra arguments are ignored. The number of arguments is variable and may be
zero.getInfoMessages()public org.eclipse.collections.api.list.ImmutableList<String> getInfoMessages()
public org.eclipse.collections.api.list.ImmutableList<String> getErrorMessages()
public boolean hasErrors()
true if there are error messages, false otherwiseCopyright © 2018. All rights reserved.