Class LMinMax

java.lang.Object
org.supercsv.cellprocessor.CellProcessorAdaptor
org.supercsv.cellprocessor.constraint.LMinMax
All Implemented Interfaces:
CellProcessor, StringCellProcessor

public class LMinMax extends CellProcessorAdaptor implements StringCellProcessor
Converts the input data to a Long and and ensures the value is between the supplied min and max values (inclusive). If the data has no upper or lower bound, you should use either of MIN or MAX constants provided in the class.
Author:
Kasper B. Graversen, James Bassett
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum value for 8 bits (signed)
    static final int
    Maximum value for 8 bits (unsigned)
    static final int
    Maximum value for a Character
    static final int
    Maximum value for an Integer
    static final long
    Maximum value for a Long
    static final short
    Maximum value for a Short
    static final int
    Minimum value for 8 bits (signed)
    static final int
    Minimum value for 8 bits (unsigned)
    static final int
    Minimum value for a Character
    static final int
    Minimum value for an Integer
    static final long
    Minimum value for a Long
    static final short
    Minimum value for a Short

    Fields inherited from class CellProcessorAdaptor

    next
  • Constructor Summary

    Constructors
    Constructor
    Description
    LMinMax(long min, long max)
    Constructs a new LMinMax processor, which converts the input data to a Long and and ensures the value is between the supplied min and max values.
    LMinMax(long min, long max, LongCellProcessor next)
    Constructs a new LMinMax processor, which converts the input data to a Long and and ensures the value is between the supplied min and max values, then calls 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 CellProcessorAdaptor

    toString, validateInputNotNull

    Methods inherited from class Object

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

    • MAX_LONG

      public static final long MAX_LONG
      Maximum value for a Long
      See Also:
    • MIN_LONG

      public static final long MIN_LONG
      Minimum value for a Long
      See Also:
    • MAX_INTEGER

      public static final int MAX_INTEGER
      Maximum value for an Integer
      See Also:
    • MIN_INTEGER

      public static final int MIN_INTEGER
      Minimum value for an Integer
      See Also:
    • MAX_SHORT

      public static final short MAX_SHORT
      Maximum value for a Short
      See Also:
    • MIN_SHORT

      public static final short MIN_SHORT
      Minimum value for a Short
      See Also:
    • MAX_CHAR

      public static final int MAX_CHAR
      Maximum value for a Character
      See Also:
    • MIN_CHAR

      public static final int MIN_CHAR
      Minimum value for a Character
      See Also:
    • MAX_8_BIT_UNSIGNED

      public static final int MAX_8_BIT_UNSIGNED
      Maximum value for 8 bits (unsigned)
      See Also:
    • MIN_8_BIT_UNSIGNED

      public static final int MIN_8_BIT_UNSIGNED
      Minimum value for 8 bits (unsigned)
      See Also:
    • MAX_8_BIT_SIGNED

      public static final int MAX_8_BIT_SIGNED
      Maximum value for 8 bits (signed)
      See Also:
    • MIN_8_BIT_SIGNED

      public static final int MIN_8_BIT_SIGNED
      Minimum value for 8 bits (signed)
      See Also:
  • Constructor Details

    • LMinMax

      public LMinMax(long min, long max)
      Constructs a new LMinMax processor, which converts the input data to a Long and and ensures the value is between the supplied min and max values.
      Parameters:
      min - the minimum value (inclusive)
      max - the maximum value (inclusive)
      Throws:
      IllegalArgumentException - if max < min
    • LMinMax

      public LMinMax(long min, long max, LongCellProcessor next)
      Constructs a new LMinMax processor, which converts the input data to a Long and and ensures the value is between the supplied min and max values, then calls the next processor in the chain.
      Parameters:
      min - the minimum value (inclusive)
      max - the maximum value (inclusive)
      next - the next processor in the chain
      Throws:
      NullPointerException - if next is null
      IllegalArgumentException - if max < min
  • Method Details