All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.neotys.neoload.model.v3.binding.converter.StopAfterToStringConverter Maven / Gradle / Ivy

package com.neotys.neoload.model.v3.binding.converter;

import com.fasterxml.jackson.databind.util.StdConverter;
import com.neotys.neoload.model.v3.project.scenario.StopAfter;

public final class StopAfterToStringConverter extends StdConverter {
	@Override
	public String convert(final StopAfter stopAfter) {
		if (stopAfter == null) return null;
		
		String convertedValue;
		final StopAfter.Type type = stopAfter.getType();
		if (type == StopAfter.Type.TIME) {
			convertedValue = TimeDurationHelper.convertToString((Integer) stopAfter.getValue());
		}
		else {
			convertedValue = "current_iteration";
		}
		return convertedValue;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy