public class History extends java.lang.Object
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 java.util.List<HistoryOsmPrimitive> |
versions
the list of object snapshots
|
Modifier | Constructor and Description |
---|---|
protected |
History(long id,
OsmPrimitiveType type,
java.util.List<HistoryOsmPrimitive> versions)
Creates a new history for an OSM primitive
|
Modifier and Type | Method and Description |
---|---|
History |
between(java.util.Date fromDate,
java.util.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(java.util.Date fromDate) |
History |
from(long fromVersion) |
HistoryOsmPrimitive |
get(int idx) |
HistoryOsmPrimitive |
getByDate(java.util.Date date) |
HistoryOsmPrimitive |
getByVersion(long version)
Replies the history primitive with version
version . |
HistoryOsmPrimitive |
getEarliest() |
long |
getId() |
HistoryOsmPrimitive |
getLatest() |
int |
getNumVersions() |
PrimitiveId |
getPrimitiveId()
Replies the primitive id for this history.
|
OsmPrimitiveType |
getType() |
boolean |
isEmpty()
Returns true if this history contains no version.
|
History |
sortAscending() |
History |
sortDescending() |
java.lang.String |
toString() |
History |
until(java.util.Date untilDate) |
History |
until(long untilVersion) |
private java.util.List<HistoryOsmPrimitive> versions
private final long id
private final OsmPrimitiveType type
protected History(long id, OsmPrimitiveType type, java.util.List<HistoryOsmPrimitive> versions)
id
- the id. > 0 required.type
- the primitive type. Must not be null.versions
- a list of versions. Can be null.java.lang.IllegalArgumentException
- thrown if id <= 0java.lang.IllegalArgumentException
- 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(java.util.Date date)
public HistoryOsmPrimitive get(int idx) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public HistoryOsmPrimitive getEarliest()
public HistoryOsmPrimitive getLatest()
public int getNumVersions()
public final boolean isEmpty()
true
if this history contains no version, false
otherwisepublic OsmPrimitiveType getType()
public java.lang.String toString()
toString
in class java.lang.Object