TaskInfo.Builder

public abstract class TaskInfo.Builder<T extends TaskOptions>


Builder for TaskInfo.

Summary

Public constructors

Public methods

abstract TaskInfo<T>
final TaskInfo<T>

Validates and builds the TaskInfo instance. *

abstract TaskInfo.Builder<T>
setEnableFlowLimiting(boolean value)

Sets to true if the task requires a flow limiter.

abstract TaskInfo.Builder<T>

Sets a list of task graph input side packet info Strings in the form TAG:name.

abstract TaskInfo.Builder<T>

Sets a list of task graph input stream info Strings in the form TAG:name.

abstract TaskInfo.Builder<T>

Sets a list of task graph output stream info Strings in the form TAG:name.

abstract TaskInfo.Builder<T>

Sets the MediaPipe task graph name.

abstract TaskInfo.Builder<T>

Sets the MediaPipe task name, e.g. "FaceDetector".

abstract TaskInfo.Builder<T>
setTaskOptions(T value)

Sets a task-specific options instance.

abstract TaskInfo.Builder<T>

Sets the MediaPipe task running mode name.

Public constructors

Builder

public Builder()

Public methods

autoBuild

public abstract TaskInfo<T> autoBuild()

build

public final TaskInfo<T> build()

Validates and builds the TaskInfo instance. *

Throws
java.lang.IllegalArgumentException

if the required information such as task graph name, graph input streams, and the graph output streams are empty.

setEnableFlowLimiting

public abstract TaskInfo.Builder<T> setEnableFlowLimiting(boolean value)

Sets to true if the task requires a flow limiter.

setInputSidePackets

public abstract TaskInfo.Builder<T> setInputSidePackets(List<String> value)

Sets a list of task graph input side packet info Strings in the form TAG:name.

setInputStreams

public abstract TaskInfo.Builder<T> setInputStreams(List<String> value)

Sets a list of task graph input stream info Strings in the form TAG:name.

setOutputStreams

public abstract TaskInfo.Builder<T> setOutputStreams(List<String> value)

Sets a list of task graph output stream info Strings in the form TAG:name.

setTaskGraphName

public abstract TaskInfo.Builder<T> setTaskGraphName(String value)

Sets the MediaPipe task graph name.

setTaskName

public abstract TaskInfo.Builder<T> setTaskName(String value)

Sets the MediaPipe task name, e.g. "FaceDetector".

The name identifies the task in usage logging (SolutionName.TASKS_<NAME>). Pass a string literal, never a class name obtained through reflection: apps commonly ship with R8/ProGuard, which renames classes, so getSimpleName() yields an arbitrary name on the device and the task is logged as SOLUTION_UNKNOWN.

setTaskOptions

public abstract TaskInfo.Builder<T> setTaskOptions(T value)

Sets a task-specific options instance.

Parameters
T value

a task-specific options that is derived from TaskOptions.

setTaskRunningModeName

public abstract TaskInfo.Builder<T> setTaskRunningModeName(String value)

Sets the MediaPipe task running mode name.