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 classQAWarning.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 QAWarningaggregate(QAWarning other)Aggregates another QA warning of the same aggregation id.intcompareTo(QAWarning other)Warnings are sorted by decreasing severity.booleanequals(Object other)StringgetAggregationId()StringgetBucketId()intgetCount()Map<String,Object>getProperties()QAWarning.SeveritygetSeverity()StringgetType()booleanisFacetable()voidsetFacetable(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.voidsetProperty(String key, Object value)Sets a property of the QA warning, to be used by the front-end for display.StringtoString()
-
-
-
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:
compareToin interfaceComparable<QAWarning>
-
-