Sped up parsing allowed job names
This commit is contained in:
parent
2401b0e85c
commit
bd77a8b6f4
|
@ -257,11 +257,11 @@ open class ResponseParser @JvmOverloads constructor(
|
||||||
|
|
||||||
protected open fun parseAllowedJobNames(dataElementGroups: List<String>): List<String> {
|
protected open fun parseAllowedJobNames(dataElementGroups: List<String>): List<String> {
|
||||||
|
|
||||||
return dataElementGroups.mapNotNull { parseAllowedJobName(it) }
|
return dataElementGroups.filterNot { it.isEmpty() }.mapNotNull { parseAllowedJobName(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun parseAllowedJobName(dataElementGroup: String): String? {
|
protected open fun parseAllowedJobName(dataElementGroup: String): String? {
|
||||||
val dataElements = getDataElements(dataElementGroup)
|
val dataElements = getDataElementsThatContainsNoMaskSeparators(dataElementGroup)
|
||||||
|
|
||||||
if (dataElements.size > 0) {
|
if (dataElements.size > 0) {
|
||||||
val jobName = parseString(dataElements[0])
|
val jobName = parseString(dataElements[0])
|
||||||
|
@ -704,6 +704,10 @@ open class ResponseParser @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected open fun getDataElementsThatContainsNoMaskSeparators(dataElementGroup: String): List<String> {
|
||||||
|
return dataElementGroup.split(Separators.DataElementsSeparator)
|
||||||
|
}
|
||||||
|
|
||||||
protected open fun getDataElements(dataElementGroup: String): List<String> {
|
protected open fun getDataElements(dataElementGroup: String): List<String> {
|
||||||
return splitIntoPartsAndUnmask(dataElementGroup, Separators.DataElementsSeparator)
|
return splitIntoPartsAndUnmask(dataElementGroup, Separators.DataElementsSeparator)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue