net.nemerosa.ontrack.ui.support.StringToID Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-ui-support Show documentation
Show all versions of ontrack-ui-support Show documentation
Ontrack module: ontrack-ui-support
package net.nemerosa.ontrack.ui.support;
import net.nemerosa.ontrack.model.structure.ID;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;
public class StringToID implements Converter {
@Override
public ID convert(String source) {
if (StringUtils.isNumeric(source)) {
return ID.of(Integer.parseInt(source, 10));
} else {
return ID.NONE;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy