Interface CustomWarningProvider
A interface representing a provider of custom warnings based on vehicle position.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the custom warning type identifier produced by this provider.getWarnings(SegmentData currentSegment, SegmentData previousSegment) Returns a list of custom warnings for the given vehicle position.
-
Method Details
-
getCustomWarningType
int getCustomWarningType()Returns the custom warning type identifier produced by this provider.
The returned value corresponds to
CustomWarning.customWarningTypeandWarning.customWarningTypeand is used to apply per-type configuration, such as notification distances.- Returns:
The custom warning type identifier for this provider.
-
getWarnings
@NonNull List<CustomWarning> getWarnings(@NonNull SegmentData currentSegment, @Nullable SegmentData previousSegment) Returns a list of custom warnings for the given vehicle position.
This method evaluates the custom warning provider using the current vehicle position on the electronic horizon and returns the resulting custom warnings along with corresponding payload.
- Parameters:
currentSegment-Segment data representing the vehicle’s current position on the electronic horizon.
previousSegment-Segment data representing the vehicle’s previous position on the electronic horizon. This parameter may be null if no previous position information is available.
- Returns:
A list of
CustomWarninginstances representing all applicable custom warnings. The list may be empty if no warnings apply.
-