Package org.openrefine.wikibase.qa
Class QAWarning
- java.lang.Object
-
- org.openrefine.wikibase.qa.QAWarning
-
- All Implemented Interfaces:
Comparable<QAWarning>
public class QAWarning extends Object implements Comparable<QAWarning>
A class to represent a QA warning emitted by the Wikidata schema This could probably be reused at a broader scale, for instance for Data Package validation.- Author:
- Antonin Delpeuch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QAWarning.Severity
-
Constructor Summary
Constructors Constructor Description QAWarning(String type, String bucketId, QAWarning.Severity severity, int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QAWarning
aggregate(QAWarning other)
Aggregates another QA warning of the same aggregation id.int
compareTo(QAWarning other)
Warnings are sorted by decreasing severity.boolean
equals(Object other)
String
getAggregationId()
String
getBucketId()
int
getCount()
Map<String,Object>
getProperties()
QAWarning.Severity
getSeverity()
String
getType()
boolean
isFacetable()
void
setFacetable(boolean facetable)
Sets whether we should offer the user the possibility to create a facet which locates the rows generating this issue in the grid.void
setProperty(String key, Object value)
Sets a property of the QA warning, to be used by the front-end for display.String
toString()
-
-
-
Constructor Detail
-
QAWarning
public QAWarning(String type, String bucketId, QAWarning.Severity severity, int count)
-
-
Method Detail
-
getAggregationId
public String getAggregationId()
- Returns:
- the full key for aggregation of QA warnings
-
aggregate
public QAWarning aggregate(QAWarning other)
Aggregates another QA warning of the same aggregation id.- Parameters:
other
-
-
setProperty
public void setProperty(String key, Object value)
Sets a property of the QA warning, to be used by the front-end for display.- Parameters:
key
- : the name of the propertyvalue
- should be Jackson-serializable
-
setFacetable
public void setFacetable(boolean facetable)
Sets whether we should offer the user the possibility to create a facet which locates the rows generating this issue in the grid.- Parameters:
facetable
-
-
getType
public String getType()
-
getBucketId
public String getBucketId()
-
getSeverity
public QAWarning.Severity getSeverity()
-
getCount
public int getCount()
-
isFacetable
public boolean isFacetable()
-
compareTo
public int compareTo(QAWarning other)
Warnings are sorted by decreasing severity.- Specified by:
compareTo
in interfaceComparable<QAWarning>
-
-