public class IncidentUtils extends Object
Constructor and Description |
---|
IncidentUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
applyFilter(List<T> items,
IFilter<T> filter)
Filter the list with the user provided filter.
|
static Comparator<Incident> |
getDefaultComparator()
Gets the default incidents comparator for sorting for alerts.
|
static IFilter<Incident> |
getDefaultFilter()
Gets the default filter.
|
static Comparator<Incident> |
getDefaultListComparator()
Get default incidents comparator for sorting for displaying incidents in a list.
|
static IFilter<Incident> |
getIncidentFilter(Set<Incident.IncidentType> incidentTypesAllowed)
Get a custom filter which can selectively allow incidents.
|
static boolean |
isRoadClosure(Integer eventCode)
Returns whether an event code is a road closure, per ISO 14819-1:2003.
|
public static boolean isRoadClosure(Integer eventCode)
eventCode
- The event code.true
if the event code is a road closure; otherwise, false
.public static Comparator<Incident> getDefaultComparator()
public static Comparator<Incident> getDefaultListComparator()
public static IFilter<Incident> getDefaultFilter()
Incident.IncidentType.CONSTRUCTION
and Incident.IncidentType.UNKNOWN
incidents.public static IFilter<Incident> getIncidentFilter(@NonNull Set<Incident.IncidentType> incidentTypesAllowed)
incidentTypesAllowed
- A set of Incident.IncidentType
s that should return
true
when IFilter.isItemAllowed(T)
is called.Incident
filter.@NonNull public static <T> List<T> applyFilter(List<T> items, IFilter<T> filter)
T
- Target list element type.items
- The list of items that needs to be filtered.filter
- The filter to apply to the list.Copyright © 2013-2016 INRIX, Inc. All Rights Reserved.