I need to convert the following kotlin code to java:
private fun processPurchases(allPurchases: List<Purchase>, purchasedProductsFetched: Boolean) {
val validPurchases = allPurchases.filter {
isPurchaseSignatureValid(it)
}.map { purchase ->
val skuDetails = fetchedSkuInfosList.find { it.skuId == purchase.sku }!!.skuDetails
PurchaseInfo(
generateSkuInfo(skuDetails),
purchase
)
}
}
I am stuck after .map part and can't figure out what's going on...
private void processPurchases(List<Purchase> allPurchases, boolean purchasedProductsFetched) {
List<Purchase> validPurchases = new ArrayList<>();
for (Purchase purchase : allPurchases) {
if (isPurchaseSignatureValid(purchase)) {
validPurchases.add(purchase);
}
}
}
Can someone explain what to do next?