Inputs must be added in the same order as inputs of the corresponding model. It
accepts array, multidimensional array or a direct ByteBuffer as
inputs of primitive types including int, float, long, and byte.
ByteBuffer is
the preferred way to pass large input data. When ByteBuffer is
used, its content should remain unchanged until model inference is done. Its type and
dimensions must match the corresponding configurations provided by
FirebaseModelInputOutputOptions.
Array and multidimensional array are also supported formats for input. However,
these formats have performance impact especially when the data size is large. Please
use it mainly for debugging or latency non-sensitive use cases.
Parameters
input
an array, multidimensional array, or a direct ByteBuffer
of primitive types including int, float, long, and byte.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-08-08 UTC."],[],[],null,["# FirebaseModelInputs.Builder\n\npublic static class **FirebaseModelInputs.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nBuilder class of `FirebaseModelInputs`. \n\n### Public Constructor Summary\n\n|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [FirebaseModelInputs.Builder](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs.Builder#FirebaseModelInputs.Builder())() Creates a new builder to build `FirebaseModelInputs`. |\n\n### Public Method Summary\n\n|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [FirebaseModelInputs.Builder](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs.Builder) | [add](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs.Builder#add(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) input) Adds an input for custom model inference. |\n| [FirebaseModelInputs](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs) | [build](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs.Builder#build())() Builds a `FirebaseModelInputs`. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **FirebaseModelInputs.Builder** ()\n\nCreates a new builder to build `FirebaseModelInputs`.\n\nPublic Methods\n--------------\n\n#### public [FirebaseModelInputs.Builder](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs.Builder)\n**add** ([Object](//developer.android.com/reference/java/lang/Object.html) input)\n\nAdds an input for custom model inference.\n\nInputs must be added in the same order as inputs of the corresponding model. It\naccepts array, multidimensional array or a direct [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html) as\ninputs of primitive types including int, float, long, and byte.\n\n[ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html) is\nthe preferred way to pass large input data. When [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html) is\nused, its content should remain unchanged until model inference is done. Its type and\ndimensions must match the corresponding configurations provided by [FirebaseModelInputOutputOptions](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputOutputOptions).\n\nArray and multidimensional array are also supported formats for input. However,\nthese formats have performance impact especially when the data size is large. Please\nuse it mainly for debugging or latency non-sensitive use cases. \n\n##### Parameters\n\n| input | an array, multidimensional array, or a direct [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html) of primitive types including int, float, long, and byte. |\n|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- a builder to build the `FirebaseModelInputs`. \n\n##### Throws\n\n| [NullPointerException](//developer.android.com/reference/java/lang/NullPointerException.html) | if the input object is null. |\n| [IllegalArgumentException](//developer.android.com/reference/java/lang/IllegalArgumentException.html) | if the input object is not a [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html), an array or a multidimensional array. |\n| [FirebaseMLException](/docs/reference/android/com/google/firebase/ml/common/FirebaseMLException) | if the input is not a direct [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html) or is not in [nativeOrder()](//developer.android.com/reference/java/nio/ByteOrder.html#nativeOrder()). See also [Direct VS non-direct buffers.](//developer.android.com/reference/java/nio/ByteBuffer#direct-vs-non-direct-buffers) |\n|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FirebaseModelInputs](/docs/reference/android/com/google/firebase/ml/custom/FirebaseModelInputs)\n**build** ()\n\nBuilds a `FirebaseModelInputs`."]]