public class ChangesetQuery extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ChangesetQuery.ChangesetQueryUrlException |
static class |
ChangesetQuery.ChangesetQueryUrlParser |
| Modifier and Type | Field and Description |
|---|---|
private Bounds |
bounds
the bounding box this query is restricted to.
|
private java.util.Collection<java.lang.Long> |
changesetIds
a collection of changeset ids to query for
|
private java.lang.Boolean |
closed
indicates whether only closed changesets are queried.
|
private java.util.Date |
closedAfter |
private java.util.Date |
createdBefore |
private java.lang.Boolean |
open
indicates whether only open changesets are queried.
|
private java.lang.Integer |
uid
the user id this query is restricted to.
|
private java.lang.String |
userName
the user name this query is restricted to.
|
| Constructor and Description |
|---|
ChangesetQuery()
Constructs a new
ChangesetQuery. |
| Modifier and Type | Method and Description |
|---|---|
ChangesetQuery |
beingClosed(boolean isClosed)
Restricts the result to changesets which are or aren't closed, depending on the value of
isClosed |
ChangesetQuery |
beingOpen(boolean isOpen)
Restricts the result to changesets which are or aren't open, depending on the value of
isOpen |
static ChangesetQuery |
buildFromUrlQuery(java.lang.String query)
Replies a changeset query object from the query part of a OSM API URL for querying changesets.
|
ChangesetQuery |
closedAfter(java.util.Date d)
Restricts the result to changesets which have been closed after the date given by
d. |
ChangesetQuery |
closedAfterAndCreatedBefore(java.util.Date closedAfter,
java.util.Date createdBefore)
Restricts the result to changesets which have been closed after
closedAfter and which
habe been created before createdBefore. |
ChangesetQuery |
forChangesetIds(java.util.Collection<java.lang.Long> changesetIds)
Restricts the query to the given changeset ids (which are added to previously added ones).
|
ChangesetQuery |
forUser(int uid)
Restricts the query to changesets owned by the user with id
uid. |
ChangesetQuery |
forUser(java.lang.String username)
Restricts the query to changesets owned by the user with user name
username. |
java.lang.String |
getQueryString()
Replies the query string to be used in a query URL for the OSM API.
|
java.lang.String |
getUserName()
Replies the user name which this query is restricted to.
|
ChangesetQuery |
inBbox(Bounds bbox)
Replies a query which is restricted to a bounding box given by
bbox. |
ChangesetQuery |
inBbox(double minLon,
double minLat,
double maxLon,
double maxLat)
Replies a query which is restricted to a bounding box.
|
ChangesetQuery |
inBbox(LatLon min,
LatLon max)
Replies a query which is restricted to a bounding box.
|
boolean |
isRestrictedToFullyIdentifiedUser()
Replies true if this query is restricted to user whom know the user id for.
|
boolean |
isRestrictedToPartiallyIdentifiedUser()
Replies true if this query is restricted to user whom we only know the user name for.
|
java.lang.String |
toString() |
private java.lang.Integer uid
private java.lang.String userName
private Bounds bounds
private java.util.Date closedAfter
private java.util.Date createdBefore
private java.lang.Boolean open
private java.lang.Boolean closed
private java.util.Collection<java.lang.Long> changesetIds
public ChangesetQuery()
ChangesetQuery.public static ChangesetQuery buildFromUrlQuery(java.lang.String query) throws ChangesetQuery.ChangesetQueryUrlException
query - the query partChangesetQuery.ChangesetQueryUrlException - thrown if query doesn't consist of valid query parameterspublic ChangesetQuery forUser(int uid) throws java.lang.IllegalArgumentException
uid.uid - the uid of the user. > 0 expected.java.lang.IllegalArgumentException - thrown if uid <= 0forUser(String)public ChangesetQuery forUser(java.lang.String username)
username.
Caveat: for historical reasons the username might not be unique! It is recommended to use
forUser(int) to restrict the query to a specific user.username - the username. Must not be null.java.lang.IllegalArgumentException - thrown if username is null.forUser(int)public boolean isRestrictedToPartiallyIdentifiedUser()
public java.lang.String getUserName()
isRestrictedToPartiallyIdentifiedUser() is false.public boolean isRestrictedToFullyIdentifiedUser()
public ChangesetQuery inBbox(double minLon, double minLat, double maxLon, double maxLat) throws java.lang.IllegalArgumentException
minLon - min longitude of the bounding box. Valid longitude value expected.minLat - min latitude of the bounding box. Valid latitude value expected.maxLon - max longitude of the bounding box. Valid longitude value expected.maxLat - max latitude of the bounding box. Valid latitude value expected.java.lang.IllegalArgumentException - thrown if either of the parameters isn't a valid longitude or
latitude valuepublic ChangesetQuery inBbox(LatLon min, LatLon max)
min - the min lat/lon coordinates of the bounding box. Must not be null.max - the max lat/lon coordiantes of the bounding box. Must not be null.java.lang.IllegalArgumentException - thrown if min is nulljava.lang.IllegalArgumentException - thrown if max is nullpublic ChangesetQuery inBbox(Bounds bbox) throws java.lang.IllegalArgumentException
bbox.bbox - the bounding box. Must not be null.java.lang.IllegalArgumentException - thrown if bbox is null.public ChangesetQuery closedAfter(java.util.Date d) throws java.lang.IllegalArgumentException
d.
d d is a date relative to the current time zone.d - the date . Must not be null.java.lang.IllegalArgumentException - thrown if d is nullpublic ChangesetQuery closedAfterAndCreatedBefore(java.util.Date closedAfter, java.util.Date createdBefore) throws java.lang.IllegalArgumentException
closedAfter and which
habe been created before createdBefore. Both dates are expressed relative to the current
time zone.closedAfter - only reply changesets closed after this date. Must not be null.createdBefore - only reply changesets created before this date. Must not be null.java.lang.IllegalArgumentException - thrown if closedAfter is nulljava.lang.IllegalArgumentException - thrown if createdBefore is nullpublic ChangesetQuery beingOpen(boolean isOpen)
isOpenisOpen - whether changesets should or should not be openpublic ChangesetQuery beingClosed(boolean isClosed)
isClosedisClosed - whether changesets should or should not be openpublic ChangesetQuery forChangesetIds(java.util.Collection<java.lang.Long> changesetIds)
changesetIds - the changeset idsjava.lang.IllegalArgumentException - thrown if changesetIds is null.public java.lang.String getQueryString()
public java.lang.String toString()
toString in class java.lang.Object