@ SuppressWarnings ( "unchecked" ) static < T > Monitor < T > wrap ( TagList tags , Monitor < T > monitor ) { Monitor < T > m ; if ( monitor instanceof CompositeMonitor < ? > ) { m = new CompositeMonitorWrapper <> ( tags , ( CompositeMonitor < T > ) monitor ) ; } else { m = MonitorWrapper . create ( tags , monitor ) ; } return m ; }
Returns a new monitor that adds the provided tags to the configuration returned by the wrapped monitor .