public class Arguments
extends java.lang.Object
| Constructor and Description |
|---|
Arguments() |
| Modifier and Type | Method and Description |
|---|---|
static WritableArray |
createArray()
This method should be used when you need to stub out creating NativeArrays in unit tests.
|
static WritableMap |
createMap()
This method should be used when you need to stub out creating NativeMaps in unit tests.
|
static WritableArray |
fromArray(java.lang.Object array)
Convert an array to a
WritableArray. |
static WritableMap |
fromBundle(android.os.Bundle bundle)
Convert a
Bundle to a WritableMap. |
static WritableNativeArray |
fromJavaArgs(java.lang.Object[] args) |
static WritableArray |
fromList(java.util.List list)
Convert a
List to a WritableArray. |
static WritableNativeArray |
makeNativeArray(java.util.List objects)
This method converts a List into a NativeArray.
|
static <T> WritableNativeArray |
makeNativeArray(java.lang.Object objects)
This overload is like the above, but uses reflection to operate on any primitive or object
type.
|
static WritableNativeMap |
makeNativeMap(android.os.Bundle bundle)
Like the above, but takes a Bundle instead of a Map.
|
static WritableNativeMap |
makeNativeMap(java.util.Map<java.lang.String,java.lang.Object> objects)
This method converts a Map into a NativeMap.
|
static android.os.Bundle |
toBundle(ReadableMap readableMap)
Convert a
WritableMap to a Bundle. |
static java.util.ArrayList |
toList(ReadableArray readableArray)
Convert a
WritableArray to a ArrayList. |
public static WritableNativeArray makeNativeArray(java.util.List objects)
public static <T> WritableNativeArray makeNativeArray(java.lang.Object objects)
public static WritableNativeMap makeNativeMap(java.util.Map<java.lang.String,java.lang.Object> objects)
public static WritableNativeMap makeNativeMap(android.os.Bundle bundle)
public static WritableArray createArray()
public static WritableMap createMap()
public static WritableNativeArray fromJavaArgs(java.lang.Object[] args)
public static WritableArray fromArray(java.lang.Object array)
WritableArray.array - the array to convert. Supported types are: String[], Bundle[],
int[], float[], double[], boolean[].WritableArrayjava.lang.IllegalArgumentException - if the passed object is none of the above typespublic static WritableArray fromList(java.util.List list)
List to a WritableArray.list - the list to convert. Supported value types are: null, String,
Bundle, List, Number, Boolean, and all array types
supported in fromArray(Object).WritableArrayjava.lang.IllegalArgumentException - if one of the values from the passed list is none of the above
typespublic static WritableMap fromBundle(android.os.Bundle bundle)
Bundle to a WritableMap. Supported key types in the bundle are:
fromArray(Object)
fromList(List)
Bundle objects that are recursively converted to maps
bundle - the Bundle to convertWritableMapjava.lang.IllegalArgumentException - if there are keys of unsupported typespublic static java.util.ArrayList toList(ReadableArray readableArray)
WritableArray to a ArrayList.readableArray - the WritableArray to convert.ArrayList.public static android.os.Bundle toBundle(ReadableMap readableMap)
readableMap - the WritableMap to convert.Bundle.