org.javasimon.source.DisabledStopwatchSource Maven / Gradle / Ivy
package org.javasimon.source;
import org.javasimon.Manager;
import org.javasimon.Split;
import org.javasimon.Stopwatch;
/**
* Disabled stopwatch source.
*
* @author Richard "Virgo" Richter
* @since 3.4
*/
public class DisabledStopwatchSource implements StopwatchSource {
/**
* Singleton instance.
*/
private static final DisabledStopwatchSource INSTANCE = new DisabledStopwatchSource();
/**
* Returns a singleton instance.
*/
@SuppressWarnings("unchecked")
public static DisabledStopwatchSource get() {
return (DisabledStopwatchSource) INSTANCE;
}
@Override
public Split start(L location) {
return Split.DISABLED;
}
@Override
public boolean isMonitored(L location) {
return false;
}
@Override
public Stopwatch getMonitor(L location) {
return null;
}
@Override
public Manager getManager() {
return null;
}
}