TrainingInterval.Builder

public static final class TrainingInterval.Builder
继承自 Object

java.lang.Object
   ↳ android.adservices.ondevicepersonalization.TrainingInterval.Builder


TrainingInterval 的构建器

摘要

公共构造函数

Builder()

公共方法

TrainingInterval build()

构建实例。

TrainingInterval.Builder setMinimumInterval(Duration value)

设置两次训练运行之间的最短时间间隔。

TrainingInterval.Builder setSchedulingMode(int value)

继承的方法

公共构造函数

公共方法

build

public TrainingInterval build ()

构建实例。调用此方法后不应再使用此构建器!

返回
TrainingInterval 此值不能为 null

setMinimumInterval

public TrainingInterval.Builder setMinimumInterval (Duration value)

设置两次训练运行之间的最短时间间隔。

仅当调度模式为 TrainingInterval.SCHEDULING_MODE_RECURRENT 时才使用此字段。仅接受正值,零或负值将导致 IllegalArgumentException。

另请注意,此值是建议值,不能保证作业在间隔过期后立即运行。联邦计算仍将强制执行最短要求的间隔和训练限制,以确保系统健康。当前的训练限制包括设备连接到非按流量计费网络、处于空闲状态且电池电量不低。

参数
value Duration:此值不能为 null

返回
TrainingInterval.Builder 此值不能为 null

setSchedulingMode

public TrainingInterval.Builder setSchedulingMode (int value)

参数
value int:值为 TrainingInterval.SCHEDULING_MODE_ONE_TIME,或 TrainingInterval.SCHEDULING_MODE_RECURRENT

返回
TrainingInterval.Builder 此值不能为 null