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

ch.sbb.polarion.extension.excel_importer.EnumUtils Maven / Gradle / Ivy

The newest version!
package ch.sbb.polarion.extension.excel_importer;

import com.polarion.alm.tracker.model.IPriorityOpt;
import com.polarion.platform.persistence.IEnumOption;
import lombok.experimental.UtilityClass;

import java.util.Optional;

@UtilityClass
public class EnumUtils {

    /**
     * For some options (e.g. 'priority') method getId() returns weird float-like containing strings ("90.0", "50.0" etc.) instead if proper ID.
     * Was noticed that proper ID can be accessed from option properties by special key 'standardOptionId'.
     */
    public String getEnumId(IEnumOption option) {
        return Optional.ofNullable(option.getProperty(IPriorityOpt.PROPERTY_KEY_STD_OPTION_ID)).orElse(option.getId());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy