Iterate over Guava ImmutableList in Scala -


i'm having trouble iterating on immutablelist guava in scala. reason i'm working them because i'm working code written in java uses guava api. however, compiler doesn't seem it. here's code:

for (blockdata: iblockdata <- block.p.a) {   *insert actions here* } 

the compiler errors this:

error:(24, 43) value filter not member of com.google.common.collect.immutablelist[net.minecraft.server.v1_8_r3.iblockdata] (blockdata: iblockdata <- block.p.a) {                       ^ 

any appreciated. thanks!

to use scalas for expression object has implement flatmap , filter guava collections not. scala comes bundled java converters, should work:

import collection.javaconverters._ (blockdata: iblockdata <- block.p.a.asscala) {   *insert actions here* } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -