fstn
10/09/2017, 9:49 AMlovis
10/09/2017, 9:52 AMctrl+space the hell out of the ide 😅fstn
10/09/2017, 10:26 AMval type: BotFlowNodeLinkType = BotFlowNodeLinkType.get(
it.camundaInputParameters
.filter { param -> param.getAttributeValue("name") == "btn_type" }
.map { it.textContent }
.firstOrNull()
?: throw MissingBtnTypeException(it.camundaInputParameters))
?: throw MissingBtnTypeException(it.camundaInputParameters)fstn
10/09/2017, 10:26 AMfstn
10/09/2017, 10:27 AMfstn
10/09/2017, 10:28 AMlovis
10/09/2017, 10:53 AMfirst instead of firstOrNull ?edwardwongtl
10/09/2017, 11:05 AMfirstOfNull returns Type? instead of Type, @lovis’s answer should be most appropriatelovis
10/09/2017, 11:21 AMfirst(predicate) will throw if not foundfstn
10/09/2017, 11:22 AMlovis
10/09/2017, 11:57 AMBotFlowNodeLinkType.get() then, that it accepts null? Then you only have to throw oncefstn
10/09/2017, 1:02 PM