com.geotab.model.search.DriverChangeSearch Maven / Gradle / Ivy
package com.geotab.model.search;
import com.geotab.model.entity.driverchange.DriverChange;
import com.geotab.model.entity.driverchange.DriverChangeType;
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 DriverChange}.
*
* When searching for status data including DeviceSearch and DiagnosticSearch the system will
* return all records that match the search criteria and interpolate the value at the provided from/to dates when there
* is no record that corresponds to the date. Interpolated records are dynamically created when the request is made and
* can be identified as not having the ID property populated. Records with an ID are stored in the database.
*
*
This search has been designed to work efficiently with these combinations of parameters:
*
* -
* Id
*
* -
* DeviceSearch + DiagnosticSearch + FromDate and/or ToDate
*
*
*
* Cannot be used with DriverGroups.
*/
@Getter @Setter
@NoArgsConstructor
public class DriverChangeSearch extends Search {
/**
* Search for {@link DriverChange} recorded for this DeviceSearch Id or in the provided Groups
*
*
Available DeviceSearch options are:.
*
* - Id
* - Group
* - GroupListSearch
*
*/
private DeviceSearch deviceSearch;
/**
* Search for {@link DriverChange} with this UserSearch Id or in the provided Groups
*
* Available UserSearch options are:.
*
* - Id
* - DriverGroups
* - DriverGroupListSearch
*
*/
private UserSearch userSearch;
/**
* Search for {@link DriverChange} records that were logged at this date or after.
*/
private LocalDateTime fromDate;
/**
* Search for {@link DriverChange} records that were logged at this date or before.
*/
private LocalDateTime toDate;
/**
* The value indicating whether to include the last driver change before the from date or the most recent driver
* change (if dates are not provided).
*/
private boolean includeOverlappedChanges;
/**
* The value indicating the {@link DriverChangeType} to search for exclusively.
*/
private DriverChangeType type;
@Builder
public DriverChangeSearch(String id, DeviceSearch deviceSearch,
UserSearch userSearch, LocalDateTime fromDate, LocalDateTime toDate,
boolean includeOverlappedChanges, DriverChangeType type) {
super(id);
this.deviceSearch = deviceSearch;
this.userSearch = userSearch;
this.fromDate = fromDate;
this.toDate = toDate;
this.includeOverlappedChanges = includeOverlappedChanges;
this.type = type;
}
}