case class Reader[I](path: Path = Path(Nil)) extends Product with Serializable
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Reader
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def \(child: PathNode): Reader[I]
- def \(idx: Int): Reader[I]
- def \(key: String): Reader[I]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val path: Path
-
def
read[O](implicit r: (Path) ⇒ RuleLike[I, O]): Rule[I, O]
Try to convert the data at
Path
to typeO
Try to convert the data at
Path
to typeO
val json = Json.parse("""{ "informations": { "label": "test" } }""") implicit val infoValidated = From[JsValue]{ __ => (__ \ "label").read[String] } val v = From[JsValue]{ __ => (__ \ "informations").read[Informations]) } v.validate(json) == Valid("test")
- r
a lookup function. This function finds data in a structure of type I, and coerce it to type O
- returns
A Rule validating the existence and validity of data at
path
.
-
def
read[J, O](sub: ⇒ RuleLike[J, O])(implicit r: (Path) ⇒ RuleLike[I, J]): Rule[I, O]
When applied, the rule will lookup for data at the given path, and apply the
sub
Rule on itWhen applied, the rule will lookup for data at the given path, and apply the
sub
Rule on itval json = Json.parse("""{ "informations": { "label": "test" } }""") val infoValidated = From[JsValue]{ __ => (__ \ "label").read(nonEmptyText) } val v = From[JsValue]{ __ => (__ \ "informations").read(infoValidated)) } v.validate(json) == Valid("test")
- sub
the constraint to apply on the subdata
- returns
A Rule validating the existence and validity of data at
path
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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
- @throws( ... )