-
Notifications
You must be signed in to change notification settings - Fork 412
Add fromJson
and toJson
fields to JsonKey
class
#146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b58dd15
to
d4edbe5
Compare
fromJsonFunction
and toJsonFunction
fields to JsonKey
class
this.nullable, | ||
this.includeIfNull, | ||
this.ignore, | ||
this.fromJsonFunction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we pick shorter names? fromJson
and toJson
would not be ambiguous in this context and I think matches with with toJson
methods on an object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack.
nullable: obj.getField('nullable').toBoolValue(), | ||
includeIfNull: obj.getField('includeIfNull').toBoolValue(), | ||
ignore: obj.getField('ignore').toBoolValue()); | ||
if (obj == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I liked the ternary conditional better, especially given the shortened form. I like if
for when the side effect is meaningful and ternary for when the assignment is meaningful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made it even better...
toJsonName); | ||
} | ||
|
||
class ConvertDataImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is Impl
adding for this name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl to scream that this class shouldn't be in the public API.
But...whatever...
ConvertDataImpl(this.name, this.paramType); | ||
} | ||
|
||
class JsonKeyImpl extends JsonKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we find a more meaningful distinction from the parent class for this name? JsonKeyWithConversion
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
fromJsonFunction
and toJsonFunction
fields to JsonKey
classfromJson
and toJson
fields to JsonKey
class
No description provided.