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

play.api.libs.json.scalacheck.Counted.scala Maven / Gradle / Ivy

package play.api.libs.json.scalacheck

trait Counted extends Any {

  def count: Int

  protected def throwOnNegative(): Nothing

  def validate(): Unit = {
    count match {
      case neg if neg < 0 => throwOnNegative()
      case pos =>
    }
  }

  def <(that: Int) = this.count < that

  def <=(that: Int) = this.count <= that

  def >(that: Int) = this.count > that

  def >=(that: Int) = this.count >= that

  def ===(that: Int) = this.count == that

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy