amazon-ion / ion-element-kotlin

IonElement is an immutable in-memory representation of the Ion data format. IonElement's API is idiomatic to Kotlin.
Apache License 2.0
8 stars 7 forks source link

`StructElement` does not have the most convenient possible way to check for the existence of a field #41

Closed dlurton closed 2 years ago

dlurton commented 4 years ago

While reviewing PR against another library that consumes IonElement, I observed that it would be nice to be able to check for the existence of a field in a struct without having to call StructElement.getOptional(String) and checking the return value for null.

Ideally, a StructElement.hasField function that returns a boolean value exists.