I want to create Kotlin utility accessible from Java that converts list of Strings to Map. So far I've written:
class Utils {
companion object {
@JvmStatic fun values(item: GSAItem): Map<String, Object> {
return item.itemDescriptor.propertyNames.map {it -> Map.Entry<String, Any!>(it, item.getPropertyValue(it)) }; }
}
}
But I'm getting error
Error:(16, 74) Kotlin: Unresolved reference: Entry
GSAItem.getPropertyValue is Java method which takes String as argument and returns Object. After that I suspect I need to find some equivalent of collect function from Java 8?
KeyStoreclass?KeyStore.Entryis a marker interface. Did you mean to usePrivateKeyEntry,SecretKeyEntryorTrustedCertificateEntryinstead?companion objects. Use plainobjects or make the function top-level and consider making it an extension function.