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

com.malliina.values.ValueValidator.scala Maven / Gradle / Ivy

There is a newer version: 3.7.4
Show newest version
package com.malliina.values

trait ValueValidator[T, U] {
  protected def build(t: T): U

  def isValid(elem: T): Boolean
  def from(elem: T): Option[U] = if (isValid(elem)) Option(build(elem)) else None
  def strip(elem: U): T
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy