Programming in Scala [Chapter 24]-Extractors
Briefly

Extractors allow you to create patterns independent of object representations, expanding the flexibility of pattern matching.
An extractor in Scala is an object with an unapply method to destructure values. For instance, consider the EMail object.
Read at Medium
[
add
]
[
|
|
]