UpdatePolicy.Builder

public static class UpdatePolicy.Builder
extends Object

java.lang.Object
   ↳ com.google.android.things.update.UpdatePolicy.Builder


The Builder is used to construct new UpdatePolicy objects.

Summary

Public constructors

UpdatePolicy.Builder()

Public methods

UpdatePolicy build()

Builds an UpdatePolicy with the parameters that have been set on this UpdatePolicy.Builder object.

UpdatePolicy.Builder setApplyDeadline(long deadline, TimeUnit unit)

Set the deadline by which an update must be applied and rebooted into.

UpdatePolicy.Builder setPolicy(int policy)

Sets the base policy to be used by this UpdatePolicy.

Inherited methods

From class java.lang.Object

Public constructors

UpdatePolicy.Builder

UpdatePolicy.Builder ()

Public methods

build

UpdatePolicy build ()

Builds an UpdatePolicy with the parameters that have been set on this UpdatePolicy.Builder object.

Returns
UpdatePolicy A new UpdatePolicy object.

Throws
IllegalArgumentException if all the required fields have not been set

setApplyDeadline

UpdatePolicy.Builder setApplyDeadline (long deadline, 
                TimeUnit unit)

Set the deadline by which an update must be applied and rebooted into.

Parameters
deadline long: The deadline.

unit TimeUnit: The time units for the deadline.

Returns
UpdatePolicy.Builder This builder

Throws
IllegalArgumentException if the deadline is not greater than 0

setPolicy

UpdatePolicy.Builder setPolicy (int policy)

Sets the base policy to be used by this UpdatePolicy.

Parameters
policy int: The update policy to follow.

Returns
UpdatePolicy.Builder This builder.

Throws
IllegalArgumentException if the value for policy is invalid