to top
Datalogic APIs
public static class

EnterpriseBatterySaverActivationItems.ActivationItem.Builder

extends Object
java.lang.Object
   ↳ com.datalogic.device.configuration.EnterpriseBatterySaverActivationItems.ActivationItem.Builder

Class Overview

Builds the ActivationItem object.

Summary

Public Constructors
Builder()
Creates a new Builder for the ActivationItem object, with the following default values:
  • `name` and `profileName` unset,
  • type equal to `ALWAYS_ON`.
Public Methods
EnterpriseBatterySaverActivationItems.ActivationItem build()
Builds and return a newly created ActivationItem object.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withAlwaysOn()
Configures the activation item to be always on, i.e.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withBatteryLevel(int batteryLevel)
Configures the activation item to be triggered when the battery level is below or equal to the specified value.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withConnection(int connectionMask)
Configures the activation item to be triggered when the device is connected to one of the connection types specified in the mask.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withName(String name)
Sets the name of the activation item.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withPocketMode(boolean active)
Configures the activation item to be triggered the pocket mode is in the state described by the `active` parameter.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withPowerSource(int powerSourceMask)
Configures the activation item to be triggered the power source is one of the ones specified in the mask.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withProfileName(String profileName)
Sets the profile name of the activation item.
EnterpriseBatterySaverActivationItems.ActivationItem.Builder withTimeInterval(int dayOfWeekStart, LocalTime timeStart, int dayOfWeekEnd, LocalTime timeEnd)
Configures the activation item to be triggered when the device is in a specific time interval.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Added in revision 44

Creates a new Builder for the ActivationItem object, with the following default values:

  • `name` and `profileName` unset,
  • type equal to `ALWAYS_ON`.
The name and profile name must be set before building the object.

Public Methods

public EnterpriseBatterySaverActivationItems.ActivationItem build ()

Added in revision 44

Builds and return a newly created ActivationItem object. The created object is guaranteed to be valid and ready to use.

Returns
  • The ActivationItem object.
Throws
IllegalStateException if the activation item is not properly configured.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withAlwaysOn ()

Added in revision 44

Configures the activation item to be always on, i.e. it will be always triggered when present. This is the default state of the device.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withBatteryLevel (int batteryLevel)

Added in revision 44

Configures the activation item to be triggered when the battery level is below or equal to the specified value.

Parameters
batteryLevel The battery level, in percentage (0-100).
Throws
IllegalArgumentException if the battery level is not in the range 0-100.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withConnection (int connectionMask)

Added in revision 44

Configures the activation item to be triggered when the device is connected to one of the connection types specified in the mask.

Parameters
connectionMask The connection types mask. Valid values are FLAG_CONNECTED_WLAN and FLAG_CONNECTED_WWAN.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withName (String name)

Added in revision 44

Sets the name of the activation item. The name must be non empty and unique among all activation items.

Parameters
name The name of the activation item.
Throws
IllegalArgumentException if the name is empty or null.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withPocketMode (boolean active)

Added in revision 44

Configures the activation item to be triggered the pocket mode is in the state described by the `active` parameter.

Parameters
active If true, the activation item is triggered when the pocket mode is active. If false, it is triggered when the pocket mode is inactive.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withPowerSource (int powerSourceMask)

Added in revision 44

Configures the activation item to be triggered the power source is one of the ones specified in the mask.

Parameters
powerSourceMask The power source types mask. Valid values are FLAG_POWER_SOURCE_USB, FLAG_POWER_SOURCE_AC, FLAG_POWER_SOURCE_WIRELESS, FLAG_POWER_SOURCE_WIRED_DOCK and FLAG_POWER_SOURCE_WIRELESS_DOCK.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withProfileName (String profileName)

Added in revision 44

Sets the profile name of the activation item. It need to match the name of a profile already defined. When the activation item is triggered, the profile will be activated.

Parameters
profileName The name of the profile.
Throws
IllegalArgumentException if the profile name is empty or null.

public EnterpriseBatterySaverActivationItems.ActivationItem.Builder withTimeInterval (int dayOfWeekStart, LocalTime timeStart, int dayOfWeekEnd, LocalTime timeEnd)

Added in revision 44

Configures the activation item to be triggered when the device is in a specific time interval.

Parameters
dayOfWeekStart The start day of the week (1-7, where 1 is Monday and 7 is Sunday).
timeStart The start time of the interval.
dayOfWeekEnd The end day of the week (1-7, where 1 is Monday and 7 is Sunday).
timeEnd The end time of the interval.
Throws
IllegalArgumentException if the start time is after the end time or if the days of the week are not in the range 1-7.