Modifier and Type | Field and Description |
---|---|
private java.util.Date |
closedAt
the date this changeset was closed at
|
private int |
commentsCount
the number of comments for this changeset
|
private ChangesetDataSet |
content
the changeset content
|
private java.util.Date |
createdAt
date this changeset was created at
|
private java.util.List<ChangesetDiscussionComment> |
discussion
the changeset discussion
|
private int |
id
the changeset id
|
private boolean |
incomplete
indicates whether this changeset is incomplete.
|
private LatLon |
max
the max.
|
static int |
MAX_CHANGESET_TAG_LENGTH
The maximum changeset tag length allowed by API 0.6
|
private LatLon |
min
the min.
|
private boolean |
open
indicates whether this changeset is still open or not
|
private java.util.Map<java.lang.String,java.lang.String> |
tags
the map of tags
|
private User |
user
the user who owns the changeset
|
Constructor and Description |
---|
Changeset()
Creates a new changeset with id 0.
|
Changeset(Changeset other)
Creates a clone of
other |
Changeset(int id)
Creates a changeset with id
id . |
Modifier and Type | Method and Description |
---|---|
void |
addDiscussionComment(ChangesetDiscussionComment comment)
Adds a comment to the changeset discussion.
|
int |
compareTo(Changeset other)
Compares this changeset to another, based on their identifier.
|
boolean |
equals(java.lang.Object obj) |
static Changeset |
fromPrimitive(OsmPrimitive primitive)
Creates a changeset with the data obtained from the given preset, i.e.,
the
changeset id , user , and
timestamp . |
java.lang.String |
get(java.lang.String key)
Replies the value of the given key; null, if there is no value for this key
|
Bounds |
getBounds()
Returns the changeset bounding box.
|
java.util.Date |
getClosedAt()
Returns the changeset closure date.
|
int |
getCommentsCount()
Replies the number of comments for this changeset.
|
ChangesetDataSet |
getContent()
Returns the changeset contents.
|
java.util.Date |
getCreatedAt()
Returns the changeset creation date.
|
java.util.List<ChangesetDiscussionComment> |
getDiscussion()
Replies the list of comments in the changeset discussion, if any.
|
java.lang.String |
getDisplayName(NameFormatter formatter)
Returns the changeset display name, as per given name formatter.
|
int |
getId()
Returns the changeset identifier.
|
java.util.Map<java.lang.String,java.lang.String> |
getKeys()
Replies the map of key/value pairs.
|
LatLon |
getMax()
Returns the max lat/lon of the changeset bounding box.
|
LatLon |
getMin()
Returns the min lat/lon of the changeset bounding box.
|
java.lang.String |
getName()
Returns the changeset name.
|
User |
getUser()
Returns the changeset user.
|
boolean |
hasContent()
Determines if this changeset has contents.
|
boolean |
hasEqualSemanticAttributes(Changeset other)
Determines if this changeset has equals semantic attributes with another one.
|
int |
hashCode() |
boolean |
hasKeys()
Replies true, if there is at least one key/value pair; false, otherwise
|
boolean |
isIncomplete()
Determines if this changeset is incomplete.
|
boolean |
isNew()
Determines if this changeset is new.
|
boolean |
isOpen()
Determines if this changeset is open.
|
java.util.Collection<java.lang.String> |
keySet()
Replies the set of keys
|
void |
mergeFrom(Changeset other)
Merges changeset metadata from another changeset.
|
void |
put(java.lang.String key,
java.lang.String value)
Sets a key/value pairs
|
void |
remove(java.lang.String key)
Removes a given key/value pair
|
void |
removeAll()
Removes all tags
|
void |
setClosedAt(java.util.Date closedAt)
Sets the changeset closure date.
|
void |
setCommentsCount(int commentsCount)
Sets the number of comments for this changeset.
|
void |
setContent(ChangesetDataSet content)
Sets the changeset contents.
|
void |
setCreatedAt(java.util.Date createdAt)
Sets the changeset creation date.
|
void |
setId(int id)
Sets the changeset identifier.
|
void |
setIncomplete(boolean incomplete)
Sets whether this changeset is incomplete
|
void |
setKeys(java.util.Map<java.lang.String,java.lang.String> keys)
Sets the map of key/value pairs
|
void |
setMax(LatLon max)
Sets the max lat/lon of the changeset bounding box.
|
void |
setMin(LatLon min)
Sets the min lat/lon of the changeset bounding box.
|
void |
setOpen(boolean open)
Sets whether this changeset is open.
|
void |
setUser(User user)
Sets the changeset user.
|
void |
visit(Visitor v)
Visitor pattern.
|
public static final int MAX_CHANGESET_TAG_LENGTH
private int id
private java.util.Date createdAt
private java.util.Date closedAt
private boolean open
private int commentsCount
private java.util.Map<java.lang.String,java.lang.String> tags
private boolean incomplete
private ChangesetDataSet content
private java.util.List<ChangesetDiscussionComment> discussion
public Changeset()
public Changeset(int id)
id
. If id > 0, sets incomplete to true.id
- the idpublic static Changeset fromPrimitive(OsmPrimitive primitive)
changeset id
, user
, and
timestamp
.primitive
- the primitive to usepublic int compareTo(Changeset other)
other
- other changeset0
if getId() == other.getId()
;
a value less than 0
if getId() < other.getId()
; and
a value greater than 0
if getId() > other.getId()
public java.lang.String getName()
public java.lang.String getDisplayName(NameFormatter formatter)
formatter
- name formatterpublic int getId()
public void setId(int id)
id
- changeset identifierpublic java.util.Date getCreatedAt()
public void setCreatedAt(java.util.Date createdAt)
createdAt
- changeset creation datepublic java.util.Date getClosedAt()
public void setClosedAt(java.util.Date closedAt)
closedAt
- changeset closure datepublic boolean isOpen()
true
if this changeset is openpublic void setOpen(boolean open)
open
- true
if this changeset is openpublic LatLon getMin()
public void setMin(LatLon min)
min
- min lat/lon of the changeset bounding boxpublic LatLon getMax()
public void setMax(LatLon max)
max
- min lat/lon of the changeset bounding boxpublic Bounds getBounds()
public int getCommentsCount()
public void setCommentsCount(int commentsCount)
commentsCount
- the number of comments for this changesetpublic java.util.Map<java.lang.String,java.lang.String> getKeys()
Tagged
public void setKeys(java.util.Map<java.lang.String,java.lang.String> keys)
Tagged
public boolean isIncomplete()
true
if this changeset is incompletepublic void setIncomplete(boolean incomplete)
incomplete
- true
if this changeset is incompletepublic void put(java.lang.String key, java.lang.String value)
Tagged
public java.lang.String get(java.lang.String key)
Tagged
public void remove(java.lang.String key)
Tagged
public boolean hasEqualSemanticAttributes(Changeset other)
other
- other changesettrue
if this changeset has equals semantic attributes with other changesetpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean hasKeys()
Tagged
public java.util.Collection<java.lang.String> keySet()
Tagged
public boolean isNew()
true
if this changeset is new (id <= 0
)public void mergeFrom(Changeset other)
other
- other changesetpublic boolean hasContent()
true
if this changeset has contentspublic ChangesetDataSet getContent()
public void setContent(ChangesetDataSet content)
content
- changeset contents, can be nullpublic java.util.List<ChangesetDiscussionComment> getDiscussion()
public void addDiscussionComment(ChangesetDiscussionComment comment)
comment
- the comment to add. Ignored if null