我在流中调用一个函数,该表达式将谓词作为返回值:
KTable<String, String> store = source
.filter((key, value) -> Path.store().apply(value));
Path.store
写在Scala
中,如下所示:
def store: String => Boolean =
(v) =>
encode(v).error.isEmpty
并且编译器抱怨:
[error] java.lang.Object cannot be converted to boolean
[error] .filter((key, value) -> Path.store().apply(value));
我必须转换为原语吗?