object MatchFailed
Singleton object that provides unapply
method to extract failure message from MatchResult
having matches
property value of false
.
- Source
- MatchFailed.scala
- Alphabetic
- By Inheritance
- MatchFailed
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
unapply(matchResult: MatchResult)(implicit prettifier: Prettifier): Option[String]
Extractor enabling patterns that match
MatchResult
havingmatches
property value offalse
, extracting the contained failure message.Extractor enabling patterns that match
MatchResult
havingmatches
property value offalse
, extracting the contained failure message.For example, you can use this extractor to get the failure message of a
MatchResult
like this:matchResult match { case MatchFailed(failureMessage) => // do something with failureMessage case _ => // when matchResult.matches equal to
true
}- matchResult
the
MatchResult
to extract the failure message from.- returns
a
Some
wrapping the contained failure message ifmatchResult.matches
is equal totrue
, elseNone
.