com.geotab.model.search.LogRecordSearch Maven / Gradle / Ivy
/*
*
* 2020 Copyright (C) Geotab Inc. All rights reserved.
*/
package com.geotab.model.search;
import com.geotab.model.Id;
import com.geotab.model.entity.logrecord.LogRecord;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* The object used to specify the arguments when searching for {@link LogRecord}.
*
* When searching for log records 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:
*
* -
* {@link Id}
*
* -
* deviceSearch + fromDate and/or toDate
*
*
*/
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class LogRecordSearch extends IdSearch {
/**
* Gets or sets search for LogRecords at this date or after.
*/
private LocalDateTime fromDate;
/**
* Gets or sets search for LogRecords at this date or before.
*/
private LocalDateTime toDate;
/**
* Gets or sets search for LogRecords for this device id.
*
* Available DeviceSearch options are:
*
* -
* {@link Id}
*
*
*/
private Id deviceSearch;
@Builder
public LogRecordSearch(String id, LocalDateTime fromDate, LocalDateTime toDate,
Id deviceSearch) {
super(id);
this.fromDate = fromDate;
this.toDate = toDate;
this.deviceSearch = deviceSearch;
}
}