java.lang.Object
org.supercsv.cellprocessor.CellProcessorAdaptor
org.supercsv.cellprocessor.constraint.Equals
All Implemented Interfaces:
BoolCellProcessor, CellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor

This constraint ensures that all input data is equal (to each other, or to a supplied constant value).
Since:
1.50
Author:
Dominique De Vito, James Bassett
  • Field Summary

    Fields inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor

    next
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new Equals processor, which ensures all input data is equal.
    Equals(Object constantValue)
    Constructs a new Equals processor, which ensures all input data is equal to the supplied constant value.
    Equals(Object constantValue, CellProcessor next)
    Constructs a new Equals processor, which ensures all input data is equal to the supplied constant value, then calls the the next processor in the chain.
    Constructs a new Equals processor, which ensures all input data is equal, then calls the the next processor in the chain.
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(Object value, CsvContext context)
    This method is invoked by the framework when the processor needs to process data or check constraints.

    Methods inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor

    toString, validateInputNotNull

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Equals

      public Equals()
      Constructs a new Equals processor, which ensures all input data is equal.
    • Equals

      public Equals(Object constantValue)
      Constructs a new Equals processor, which ensures all input data is equal to the supplied constant value.
      Parameters:
      constantValue - the constant value that all input must equal
    • Equals

      public Equals(CellProcessor next)
      Constructs a new Equals processor, which ensures all input data is equal, then calls the the next processor in the chain.
      Parameters:
      next - the next processor in the chain
      Throws:
      NullPointerException - if next is null
    • Equals

      public Equals(Object constantValue, CellProcessor next)
      Constructs a new Equals processor, which ensures all input data is equal to the supplied constant value, then calls the the next processor in the chain.
      Parameters:
      constantValue - the constant value that all input must equal
      next - the next processor in the chain
      Throws:
      NullPointerException - if next is null
  • Method Details

    • execute

      public Object execute(Object value, CsvContext context)
      This method is invoked by the framework when the processor needs to process data or check constraints.
      Specified by:
      execute in interface CellProcessor
      Parameters:
      value - the value to be processed
      context - the CSV context
      Returns:
      the result of cell processor execution
      Throws:
      SuperCsvConstraintViolationException - if value isn't equal to the constant value (or previously encountered value if a constant wasn't supplied)