trait ValidationRule[A] extends AnyRef
A ValidationRule
enables a reusable way of defining a validation rules in the application
domain. It might be composed with Endpoints using either should or
shouldNot methods and
with other
ValidationRules using logical methods
and and
or.
case class User(name: String, age: Int) val user: Endpoint[User] = ( param("name").validate(beLongerThan(3)) :: param("age").as[Int].should(beGreaterThan(0) and beLessThan(120)) ).as[User]
- Self Type
- ValidationRule[A]
- Source
- ValidationRule.scala
- Alphabetic
- By Inheritance
- ValidationRule
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to any2stringadd[ValidationRule[A]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (ValidationRule[A], B)
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to ArrowAssoc[ValidationRule[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
and(that: ValidationRule[A]): ValidationRule[A]
Combines this rule with another rule such that the new rule only validates if both the combined rules validate.
Combines this rule with another rule such that the new rule only validates if both the combined rules validate.
- that
the rule to combine with this rule
- returns
a new rule that only validates if both the combined rules validate
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
ensuring(cond: (ValidationRule[A]) ⇒ Boolean, msg: ⇒ Any): ValidationRule[A]
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to Ensuring[ValidationRule[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (ValidationRule[A]) ⇒ Boolean): ValidationRule[A]
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to Ensuring[ValidationRule[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): ValidationRule[A]
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to Ensuring[ValidationRule[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): ValidationRule[A]
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to Ensuring[ValidationRule[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to StringFormat[ValidationRule[A]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
or(that: ValidationRule[A]): ValidationRule[A]
Combines this rule with another rule such that the new rule validates if any one of the combined rules validates.
Combines this rule with another rule such that the new rule validates if any one of the combined rules validates.
- that
the rule to combine with this rule
- returns
a new rule that validates if any of the combined rules validates
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
→[B](y: B): (ValidationRule[A], B)
- Implicit
- This member is added by an implicit conversion from ValidationRule[A] to ArrowAssoc[ValidationRule[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
This is the API documentation for finch
Finch is a thin layer of purely functional basic blocks atop of [Finagle][finagle] for building composable HTTP APIs. Its mission is to provide the developers simple and robust HTTP primitives being as close as possible to the bare metal Finagle API.
Finch uses multi-project structure and contains of the following _modules_:
Please refer to the documentation for a more detailed introduction to the library.