[#147]Convert to Kotlin- data/remote/model/NoteRemote.java#191
[#147]Convert to Kotlin- data/remote/model/NoteRemote.java#191OmneyaOsman wants to merge 3 commits intoDiscordTime:devfrom
Conversation
victorrattis
left a comment
There was a problem hiding this comment.
Please consider having one commit only for this pull request.
tip: Use git rebase -i HEAD~2 and do a push with -f to force the push.
Thank you for commits.
| public String description; | ||
| var description: String? = null, | ||
| @SerializedName("user") | ||
| @Expose(serialize = false) |
There was a problem hiding this comment.
Question: why are you set the serialize value to false? I believe it is not necessary.
There was a problem hiding this comment.
it already exists in java class I didn't change it
@SerializedName("user")
@expose(serialize = false)
public String user;
| @SerializedName("id") | ||
| @Expose | ||
| public String id; | ||
| var id: String? = null, |
There was a problem hiding this comment.
Could you please consider in each variable declaration, you could organize them on one line per one, in order to keep the same organization of the other data classes.
e.g:
change that:
@JvmField
@Expose
@SerializedName("id")
var id: String? = null
to that:
@JvmField @Expose @SerializedName("id") var id: String? = null
|
|
||
| public NoteRemote(){} | ||
| } | ||
| var sessionId: String? = null |
There was a problem hiding this comment.
Could you please consider using an empty string instead of null and repeat that to all the variables of this class.
e.g:
... var sessionId: String? = ""
| var sessionId: String? = null | ||
| @SerializedName("id") | ||
| @Expose | ||
| @JvmField var id: String? = null, |
There was a problem hiding this comment.
You are using @JvmField to allow using "id" directly because there are code places (in Java) that are using the properties directly instead of using getter and setter methods.
Help me to decide what is a better way: Do you think better keep the @JvmField or remove it changing all the places that use these properties to use the getter and setter methods?
There was a problem hiding this comment.
I recognized that there is java code in the project so I have added @JvmField in order not to make any conflict, but in case the whole project will be I kotlin I recommend not to use it
1-Add new data kotlin class NoteRemote in data/remote/model package with fields provided in NoteRemote.java but in kotlin . 2-remove NoteRemote.java
1-Add new data kotlin class NoteRemote in data/remote/model package with fields provided in NoteRemote.java but in kotlin .
2-remove NoteRemote.java