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

net.nemerosa.ontrack.ui.support.StringToID Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
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