#Practicing Null Safety and telling IntelliJ I am

1 messages · Page 1 of 1 (latest)

jaunty moon
#

I have two methods, a getter and an exists method. I want it so that if I have called the exists method previously, that IntelliJ can recognise that and not error me for a nullable method. Is there an annotation for this or is it just something I would need to put up with?

lament compassBOT
#

<@&987246527741304832> please have a look, thanks.

#

You can use </chatgpt:1108714622413963314> to ask ChatGPT about your question while you wait for a human to respond.

vestal tangle
#

but tbh the easier thing will be to null-unmark the type or change your API up

jaunty moon
#

yeah I've just not added the @Nullable for now. It's not a huge deal as it's not really gonna be accessed, but just hoped there'd be something for me to use in future projects

vestal tangle
#

what is this API for?

jaunty moon
#

It's for a Minecraft mod, but it being minecraft didn't really seem to relevant haha

#

I'm just replacing a lot of the internal functionality of Item Settings and moving them to the new snapshot component functionality

#

and just have my own methods for checking for the components

jaunty moon
#

!close

lament compassBOT
# jaunty moon !close

Looks like you attempted to use a command? Please note that we only use slash-commands on this server 🙂

Try starting your message with a forward-slash / and Discord should open a popup showing you all available commands.
A command might then look like /foo 👍