default SlotsDescription mapSgeSlotsToSlots()

in src/main/java/com/epam/grid/engine/mapper/queue/sge/SgeQueueMapper.java [164:179]


    default SlotsDescription mapSgeSlotsToSlots(final String sgeSlots) {
        final SlotsDescription slotsDescription = new SlotsDescription();
        final String[] slots = sgeSlots.split(COMMA);
        slotsDescription.setSlots(Integer.parseInt(slots[0]));
        if (slots.length > 1) {
            final String slotsDescriptionString = slots[1].substring(1, slots[1].length() - 1);
            final Map<String, Integer> slotsDescriptionMap = Stream.of(slotsDescriptionString.split(COMMA))
                    .map(descriptionEntry -> descriptionEntry.split(EQUAL_SIGN))
                    .map(pair -> Map.entry(pair[0], Integer.parseInt(pair[1])))
                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
            slotsDescription.setSlotsDetails(slotsDescriptionMap);
        } else {
            slotsDescription.setSlotsDetails(Collections.emptyMap());
        }
        return slotsDescription;
    }