com.geotab.model.search.TripSearch Maven / Gradle / Ivy
package com.geotab.model.search;
import com.geotab.model.entity.trip.Trip;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* The object used to specify the arguments when searching for {@link Trip}(s).
*
* This search has been designed to work efficiently with these combinations of parameters:
*
* -
* Id
*
* -
* DeviceSearch + FromDate and/or ToDate (+ IncludeOverlappedTrips)
*
* -
* UserSearch + FromDate and/or ToDate (+ IncludeOverlappedTrips)
*
*
*
* Cannot be used with DriverGroups.
*/
@Getter @Setter
@NoArgsConstructor
public class TripSearch extends Search {
/**
* Search for {@link Trip} with this DeviceSearch Id
*
*
Available DeviceSearch options are:.
*
* - id
*
*/
private DeviceSearch deviceSearch;
/**
* Search for {@link Trip} with this UserSearch Id
*
* Available UserSearch options are:.
*
* - id
*
*/
private UserSearch userSearch;
/**
* Search for Trips recorded at this date or after. When "IncludeOverlappedTrips" is set to True, search for Trips
* where the NextTripStartTime is at this date, after or NULL.
*/
private LocalDateTime fromDate;
/**
* Search for Trips recorded at this date or before. When "IncludeOverlappedTrips" is set to True, search for Trips
* where the StartDateTime is this date or before.
*/
private LocalDateTime toDate;
/**
* A value indicating whether when OverlappedTrips is set to True; any part of a trip that overlaps with the FromDate
* or ToDate boundary will have the entire trip included in the data.
*/
private Boolean includeOverlappedTrips;
@Builder
public TripSearch(String id, DeviceSearch deviceSearch,
UserSearch userSearch, LocalDateTime fromDate, LocalDateTime toDate,
Boolean includeOverlappedTrips) {
super(id);
this.deviceSearch = deviceSearch;
this.userSearch = userSearch;
this.fromDate = fromDate;
this.toDate = toDate;
this.includeOverlappedTrips = includeOverlappedTrips;
}
}