SpeedAlertOptions.Builder

public static final class SpeedAlertOptions.Builder extends Object

Builder for building SpeedAlertOptions.

Public Constructor Summary

SpeedAlertOptions.Builder()
Creates an empty builder.

Public Method Summary

SpeedAlertOptions
build()
SpeedAlertOptions.Builder
setSeverityUpgradeDurationSeconds(int seconds)
Sets the time in seconds needed to upgrade speed alerts from MINOR to MAJOR.
SpeedAlertOptions.Builder
setSpeedAlertThresholdPercentage(SpeedAlertSeverity speedAlertSeverity, int percentageAboveLimit)
Sets the triggering threshold as a percentage for the speed alert of the specified SpeedAlertSeverity.

Inherited Method Summary

Public Constructors

public SpeedAlertOptions.Builder ()

Creates an empty builder.

Public Methods

public SpeedAlertOptions build ()

Builds a SpeedAlertOptions.

Setting the same percentage threshold for MINOR and MAJOR speed alerts disables the MINOR speed alert and will only allow MAJOR speed alert.

Throws
IllegalArgumentException if not all of the following conditions are satisfied:
  • You have set MINOR speed alert triggering threshold as a percentage with a non-negative int value
  • You have set MAJOR speed alert triggering threshold as a percentage with a non-negative int value that is at least the MINOR speed alert threshold percentage
  • You have set MAJOR speed alert triggering threshold in seconds with a positive integer value

public SpeedAlertOptions.Builder setSeverityUpgradeDurationSeconds (int seconds)

Sets the time in seconds needed to upgrade speed alerts from MINOR to MAJOR.

Speeding over MINOR percentage threshold for longer than specified seconds triggers MAJOR speed alert.

Parameters
seconds

public SpeedAlertOptions.Builder setSpeedAlertThresholdPercentage (SpeedAlertSeverity speedAlertSeverity, int percentageAboveLimit)

Sets the triggering threshold as a percentage for the speed alert of the specified SpeedAlertSeverity.

You need this method to customize the speed alert triggering thresholds as a percentage for both MINOR and MAJOR alerts.

Parameters
speedAlertSeverity
percentageAboveLimit