Can jakarta.annotation.Nullable be used for org.springframework.lang.Nullable?

128 Views Asked by At

Say I have the following class.

@Validated
@Service
class MyService {

    public void doSome(final @org.springframework.lang.Nullable String string) {
    }
}

Can I replace the org.springframework.lang.Nullable with jakarta.annotation.Nullable?

@Validated
@Service
class MyService {

    public void doSome(final @jakarta.annotation.Nullable String string) {
    }
}

With the method still work as before?

Update

I already know the Bean-Validation and it's status of Spring integration.

I'm asking those @Nullable annotations, say, with a package-info.java of the following.

@org.springframework.lang.NonNullApi
package com.mycompany;

Does spring integrated with jakarta.annotation.Nullable for the purpose of the org.springframework.lang.Nullable?

0

There are 0 best solutions below