import { IMatcher } from "../api/IMatcher" ; export class ObjectHandler { private _matcher : IMatcher ; private _handler : Function ; private constructor ( matcher , handler ) { this . _matcher = matcher ; this . _handler = handler ; } private public handle ( object ) { if ( this . _matcher . matches ( object ) ) { this . _handler ( object ) ; } } }