public native toMap() as SortedMap<String, Object>
Returns the object public state as a map.
The default implementation inspects the object reflection metadata to expose its registered public properties and fields.
A map view of the object state.
class Point:
public property x = 10
public property y = 20
p = Point()
map = p.toMap()
print(map["x"])