@Nonnull annotation for ReactPackage (#23415)

Summary:
Here are some leftovers from nullable annotations for native modules, discovered while developing native module in Kotlin. This will help improve Kotlin developer experience

[Android] [Changed] - Add Nonnull annotations to ReactPackage
Pull Request resolved: https://github.com/facebook/react-native/pull/23415

Differential Revision: D14064607

Pulled By: cpojer

fbshipit-source-id: af2ce1fc1911ee03c54b20a4fc3a6d1aba9267da
This commit is contained in:
Dulmandakh
2019-02-13 05:26:26 -08:00
committed by Facebook Github Bot
parent e6320c6e75
commit 84f40da990
2 changed files with 4 additions and 1 deletions
@@ -34,10 +34,12 @@ public interface ReactPackage {
* @param reactContext react application context that can be used to create modules
* @return list of native modules to register with the newly created catalyst instance
*/
@Nonnull
List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext);
/**
* @return a list of view managers that should be registered with {@link UIManagerModule}
*/
@Nonnull
List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext);
}
@@ -7,6 +7,7 @@
package com.facebook.react.modules.core;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import android.net.Uri;
@@ -27,7 +28,7 @@ import com.facebook.react.module.annotations.ReactModule;
public class DeviceEventManagerModule extends ReactContextBaseJavaModule {
public static final String NAME = "DeviceEventManager";
public interface RCTDeviceEventEmitter extends JavaScriptModule {
void emit(String eventName, @Nullable Object data);
void emit(@Nonnull String eventName, @Nullable Object data);
}
private final Runnable mInvokeDefaultBackPressRunnable;