All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hammerlab.io.SampleSize.scala Maven / Gradle / Ivy

There is a newer version: 5.2.1
Show newest version
package org.hammerlab.io

import caseapp.core.ArgParser
import caseapp.core.ArgParser.instance

case class SampleSize(size: Option[Int]) {
  def <(other: Long): Boolean =
    size.exists(_ < other)
}

object SampleSize {
  implicit def apply(size: Int): SampleSize = SampleSize(Some(size))

  implicit val parser: ArgParser[SampleSize] =
    instance("sample size") {
      str ⇒
        Right(
          SampleSize(
            Some(
              str.toInt
            )
          )
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy