com.geotab.model.FeedResult Maven / Gradle / Ivy
package com.geotab.model;
import static com.google.common.collect.Lists.newArrayList;
import com.geotab.model.entity.Entity;
import java.util.List;
import java.util.Optional;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
@NoArgsConstructor
@Getter
@ToString
public class FeedResult {
/**
* A list of data returned by the feed.
*/
private List data;
/**
* The last version of the data returned by the feed call. If this parameter is passed back into
* the feed call, then returned data will be the changes that occurred after the last feed call
* was made. In this way the feed can return a continuous stream of data.
*/
private String toVersion;
@Builder
public FeedResult(List data, String toVersion) {
this.data = Optional.ofNullable(data).orElse(newArrayList());
this.toVersion = toVersion;
}
}