#Help me with kotlin
1 messages · Page 1 of 1 (latest)
But when it comes to this
How can I simplify this
Im using Gson to parse a json file into my own "RawEmbed" object
But I need to check if my variables are != null to successfully get an instance of the EmbedBuilder obj (JDA)
I mean a whole lot of if else statements work but it seems to bloated
for the big if code block at the bottom of the picture, author looks like this:
Optional null?
wdym
obj?.name
for instance
Also
Believe you can create a sequence
And then run sth if everything is not null or if one thing is null etc
Anyways, null sucks
yes but embed.setTitle(obj?.name) will fail. EmbedBuilder#setTitle will throw
im trying to not pass null to anything
Well, wouldn’t you use embed?.title = obj?.name
wait that works?
Oh yeah interop sucks ass then
there is only setTitle