Annotate core classes of Fabric with NonNull and Nullable annotations

Summary:
This diff annotates core classes of Fabric with NonNull and Nullable annotations, this will help analysis of nullability plus improving integration with Kotlin clients

Changelog: Add NonNull annotation to Fabric core classes

Reviewed By: shergin

Differential Revision: D18010918

fbshipit-source-id: 40fe68470b97cdf740f52dfeb9130465aab5e6df
This commit is contained in:
David Vacca
2019-10-25 15:07:18 -07:00
committed by Facebook Github Bot
parent a58fcbff0b
commit 619e27e9a1
7 changed files with 35 additions and 27 deletions
@@ -7,6 +7,7 @@
package com.facebook.react.fabric;
import androidx.annotation.NonNull;
import com.facebook.proguard.annotations.DoNotStrip;
// This is a wrapper for the ReactNativeConfig object in C++
@@ -18,7 +19,7 @@ public interface ReactNativeConfig {
* @param param The string name of the parameter being requested.
*/
@DoNotStrip
boolean getBool(String param);
boolean getBool(@NonNull String param);
/**
* Get an integer param by string name. Default should be 0.
@@ -26,7 +27,7 @@ public interface ReactNativeConfig {
* @param param The string name of the parameter being requested.
*/
@DoNotStrip
int getInt64(String param);
int getInt64(@NonNull String param);
/**
* Get a string param by string name. Default should be "", empty string.
@@ -34,7 +35,7 @@ public interface ReactNativeConfig {
* @param param The string name of the parameter being requested.
*/
@DoNotStrip
String getString(String param);
String getString(@NonNull String param);
/**
* Get a double param by string name. Default should be 0.
@@ -42,5 +43,5 @@ public interface ReactNativeConfig {
* @param param The string name of the parameter being requested.
*/
@DoNotStrip
double getDouble(String param);
double getDouble(@NonNull String param);
}