return strategy;
}
if (timingStrategy instanceof AdaptiveTimingStrategy) {
AdaptiveTimingStrategy strategy = (AdaptiveTimingStrategy) timingStrategy;
if (config.get(DELAY_SETTING) != null) {
strategy = strategy.withDefaultDelayMillis(config.get(DELAY_SETTING));
}
if (config.get(MAX_DELAY_SETTING) != null) {
strategy = strategy.withMaximumDelayMillis(config.get(MAX_DELAY_SETTING));
}
if (config.get(MIN_DELAY_SETTING) != null) {
strategy = strategy.withMinimumDelayMillis(config.get(MIN_DELAY_SETTING));
}
if (config.get(BUSY_THRESHOLD_SETTING) != null) {
strategy = strategy.withBusyThreshold(config.get(BUSY_THRESHOLD_SETTING));
}
if (config.get(MAX_SAMPLES_SETTING) != null) {
strategy = strategy.withMaxSamples(config.get(MAX_SAMPLES_SETTING));
}
if (config.get(MAX_TIME_SETTING) != null) {
strategy = strategy.withMaxTime(config.get(MAX_TIME_SETTING));
}
return strategy;
}