com.github.vickumar1981.svalidate
A ValidatableWith[A][B] extends ValidatableWithResult[A][B][String] and using it defaults the DSL to use a String return type. This can be changed by implementing ValidatableWithResult[A][B] directly where B is return type instead.
object TestValidation { case class Contacts(facebook: Option[List[String]] = None, twitter: Option[List[String]] = None) case class ContactSettings(hasFacebookContacts: Option[Boolean] = Some(true), hasTwitterContacts: Option[Boolean] = Some(true)) implicit object ContactInfoValidator extends ValidatableWith[Contacts, ContactSettings] { override def validateWith(value: Contacts, contactSettings: ContactSettings): Validation = Validation.success } }
the class to validate
the value to validate
an additional value to validate with
a ValidationResult of type C
A ValidatableWith[A][B] extends ValidatableWithResult[A][B][String] and using it defaults the DSL to use a String return type. This can be changed by implementing ValidatableWithResult[A][B] directly where B is return type instead.
the class to validate