poi.scala icon indicating copy to clipboard operation
poi.scala copied to clipboard

Provide generic extractor for ``Cell``

Open frgomes opened this issue 9 years ago • 0 comments

It would be useful to have a generic extractor which could delegate to specialized extractors. For example:

object Cell {
  def unapply(cell: Cell): Option[(Int, Any)] =
    cell match {
      case StringCell(index, data)  => Some((index, data))
      case NumericCell(index, data) => Some((index, data))
      case BooleanCell(index, data) => Some((index, data))
      case FormulaCell(index, data) => Some((index, data))
      case _ => None
    }
}

frgomes avatar Nov 27 '15 10:11 frgomes