public class UniqueHashCode extends CellProcessorAdaptor
Compared to Unique
this processor is much more memory efficient as it only stores the set of encountered
hashcodes rather than storing references to all encountered objects. The tradeoff being possible false positives.
Prior to v1.50 this class was named Unique but has been renamed to clarify its inner workings.
next
Constructor and Description |
---|
UniqueHashCode()
Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique.
|
UniqueHashCode(CellProcessor next)
Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique, then
calls the next processor in the chain.
|
Modifier and Type | Method and Description |
---|---|
Object |
execute(Object value,
CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.
|
toString, validateInputNotNull
public UniqueHashCode()
public UniqueHashCode(CellProcessor next)
next
- the next processor in the chainNullPointerException
- if next is nullpublic Object execute(Object value, CsvContext context)
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is nullSuperCsvConstraintViolationException
- if a non-unique value is encounteredCopyright © 2007–2015 Super CSV. All rights reserved.