extractoris an object that has an
unapplymethod. It takes an object as an input and gives back arguments. Custom extractors are created using the unapply method. The
unapplymethod is called
extractorbecause it takes an element of the same set and extracts some of its parts,
applymethod also called injection acts as a constructor, takes some arguments and yields an element of a given set.
Click through for explanatory examples.