rawValue
This function returns the raw value behind a Verificable
object, without performing any checks on it.
This function is mainly useful when writing your own Predicate
functions, to get the raw value out of the Verificable
and perform necessary checks on it, returning VerificaError
if value is not considered matching.
Examples:
First, let's define an example object product
that we want to verify and wrap it with asVerificable():
Then, we can call rawValue()
to get the raw value behind the Verificable
object:
We can also call rawValue()
for any of Verificable
object properties, since they are always a Verificable
objects as well, representing the deeper nested values:
Calling rawValue()
on a Verificable
representing missing value will result in VerificaException
:
Last updated