指定されたスニペットは、オプション タイプを返すメソッド呼び出しで構成されます。前の呼び出しで None が返された場合、次のメソッドを呼び出したいと思います。このスニペットでこれを達成できます
def amountToPay : Option[TextBoxExtraction] =
getMaxByFontsize(keywordAmountsWithCurrency) match {
case None => getMaxByFontsize(keywordAmounts) match {
case None => highestKeywordAmount match {
case None => getMaxByFontsize(amountsWithCurrency) match {
case None => highestAmount
case some => some
}
case some => some
}
case some => some
}
case some => some
}
しかし、それはかなり面倒に見えます。だから私はそれを行うより良い方法があることを願っています。