@CheckReturnValue annotation marks methods whose return values should be checked. This is required because it informs the IDEs to throw a warning in case the return value is not used. For example, the users may use the methods and forget to subscribe to the RxJava objects:
system.getAction().setTakeoffAltitude(20);
Which should instead be:
Disposable d = system.getAction()
.setTakeoffAltitude(20)
.subscribe(onComplete, onError);
In the first commit, @CheckReturnValue has been added to the public methods that return a Completable, a Flowable or a Single.
When null is passed for the @NonNull annotated parameter, the IDE throws a warning in the case of Java and it's a compile-time error when called from Kotlin.
In the second commit, parameters of public methods have been annotated with NonNull. Though I had gone through the code on the gRPC side and found that the methods were null-intolerant, please let me know in case MAVSDK-Java actually expects null at someplace.
@CheckReturnValue
annotation marks methods whose return values should be checked. This is required because it informs the IDEs to throw a warning in case the return value is not used. For example, the users may use the methods and forget to subscribe to the RxJava objects:Which should instead be:
In the first commit,
@CheckReturnValue
has been added to the public methods that return aCompletable
, aFlowable
or aSingle
.null
is passed for the@NonNull
annotated parameter, the IDE throws a warning in the case of Java and it's a compile-time error when called from Kotlin.In the second commit, parameters of public methods have been annotated with
NonNull
. Though I had gone through the code on the gRPC side and found that the methods were null-intolerant, please let me know in case MAVSDK-Java actually expects null at someplace.