You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
T getSomeValue() that returns a private value T someValue with the same type and doesn't get any arguments can be converted to a Dart's getter T get someValue – potentially only under a config flag
void setSomeValue(T t) that gets a value of type T and returns void can be converted into a Dart's setter set someValue(T t) – potentially only under a config flag
get methods that only get a single argument can be converted to operator [] – potentially only under a config flag
put methods that only get two arguments can also be converted to operator []=. We still probably want to generate put because put usually returns the value in Java while []= returns void – potentially only under a config flag
equals method can overload operator == and hashCode can override the hash code getter.
More conversions that can make the code more idiomatic to Dart? Feel free to suggest.
The text was updated successfully, but these errors were encountered:
Overall this is similar to what most java serialization libraries do with getters / setters. (JSON, ORMs & DB drivers). They try to convert getters and setters into fields / columns.
I actually have a locally drafted proposal about better supporting such PoD (plain old data) types, but I think we are too early in the roadmap to discuss that feature.
Uh oh!
There was an error while loading. Please reload this page.
T getSomeValue()
that returns a private valueT someValue
with the same type and doesn't get any arguments can be converted to a Dart's getterT get someValue
– potentially only under a config flagvoid setSomeValue(T t)
that gets a value of typeT
and returnsvoid
can be converted into a Dart's setterset someValue(T t)
– potentially only under a config flagget
methods that only get a single argument can be converted tooperator []
– potentially only under a config flagput
methods that only get two arguments can also be converted tooperator []=
. We still probably want to generateput
becauseput
usually returns the value in Java while[]=
returnsvoid
– potentially only under a config flagequals
method can overloadoperator ==
andhashCode
can override the hash code getter.More conversions that can make the code more idiomatic to Dart? Feel free to suggest.
The text was updated successfully, but these errors were encountered: