Modifier and Type | Class and Description |
---|---|
private static interface |
History.FilterPredicate |
Modifier and Type | Field and Description |
---|---|
private long |
id
the object id
|
private OsmPrimitiveType |
type |
private List<HistoryOsmPrimitive> |
versions
the list of object snapshots
|
Modifier | Constructor and Description |
---|---|
protected |
History(long id,
OsmPrimitiveType type,
List<HistoryOsmPrimitive> versions)
Creates a new history for an OSM primitive
|
Modifier and Type | Method and Description |
---|---|
History |
between(Date fromDate,
Date untilDate) |
History |
between(long fromVersion,
long untilVersion) |
boolean |
contains(long version) |
private static History |
filter(History history,
History.FilterPredicate predicate) |
History |
forUserId(long uid) |
History |
from(Date fromDate) |
History |
from(long fromVersion) |
HistoryOsmPrimitive |
get(int idx) |
HistoryOsmPrimitive |
getByDate(Date date) |
HistoryOsmPrimitive |
getByVersion(long version)
Replies the history primitive with version
version . null,
if no such primitive exists. |
HistoryOsmPrimitive |
getEarliest() |
long |
getId() |
HistoryOsmPrimitive |
getLatest() |
int |
getNumVersions() |
PrimitiveId |
getPrimitiveId()
Replies the primitive id for this history.
|
OsmPrimitiveType |
getType() |
boolean |
isEmpty() |
History |
sortAscending() |
History |
sortDescending() |
String |
toString() |
History |
until(Date untilDate) |
History |
until(long untilVersion) |
private List<HistoryOsmPrimitive> versions
private final long id
private final OsmPrimitiveType type
protected History(long id, OsmPrimitiveType type, List<HistoryOsmPrimitive> versions)
id
- the id. >0 required.type
- the primitive type. Must not be null.versions
- a list of versions. Can be null.IllegalArgumentException
- thrown if id <= 0IllegalArgumentException
- if type is nullprivate static History filter(History history, History.FilterPredicate predicate)
public History sortAscending()
public History sortDescending()
public long getId()
public PrimitiveId getPrimitiveId()
public boolean contains(long version)
public HistoryOsmPrimitive getByVersion(long version)
version
. null,
if no such primitive exists.version
- the versionversion
public HistoryOsmPrimitive getByDate(Date date)
public HistoryOsmPrimitive get(int idx)
public HistoryOsmPrimitive getEarliest()
public HistoryOsmPrimitive getLatest()
public int getNumVersions()
public boolean isEmpty()
public OsmPrimitiveType getType()