Class Changeset

    • Constructor Detail

      • Changeset

        public Changeset()
        Creates a new changeset with id 0.
      • Changeset

        public Changeset​(int id)
        Creates a changeset with id id. If id > 0, sets incomplete to true.
        Parameters:
        id - the id
      • Changeset

        public Changeset​(Changeset other)
        Creates a clone of other
        Parameters:
        other - the other changeset. If null, creates a new changeset with id 0.
    • Method Detail

      • compareTo

        public int compareTo​(Changeset other)
        Compares this changeset to another, based on their identifier.
        Specified by:
        compareTo in interface Comparable<Changeset>
        Parameters:
        other - other changeset
        Returns:
        the value 0 if getId() == other.getId(); a value less than 0 if getId() < other.getId(); and a value greater than 0 if getId() > other.getId()
      • getName

        public String getName()
        Returns the changeset name.
        Returns:
        the changeset name (untranslated: "changeset <identifier>")
      • getDisplayName

        public String getDisplayName​(NameFormatter formatter)
        Returns the changeset display name, as per given name formatter.
        Parameters:
        formatter - name formatter
        Returns:
        the changeset display name, as per given name formatter
      • getId

        public int getId()
        Returns the changeset identifier.
        Returns:
        the changeset identifier
      • setId

        public void setId​(int id)
        Sets the changeset identifier.
        Parameters:
        id - changeset identifier
      • getUser

        public User getUser()
        Returns the changeset user.
        Returns:
        the changeset user
      • setUser

        public void setUser​(User user)
        Sets the changeset user.
        Parameters:
        user - changeset user
      • getCreatedAt

        public Instant getCreatedAt()
        Returns the changeset creation date.
        Returns:
        the changeset creation date
      • setCreatedAt

        public void setCreatedAt​(Instant createdAt)
        Sets the changeset creation date.
        Parameters:
        createdAt - changeset creation date
      • getClosedAt

        public Instant getClosedAt()
        Returns the changeset closure date.
        Returns:
        the changeset closure date
      • setClosedAt

        public void setClosedAt​(Instant closedAt)
        Sets the changeset closure date.
        Parameters:
        closedAt - changeset closure date
      • isOpen

        public boolean isOpen()
        Determines if this changeset is open.
        Returns:
        true if this changeset is open
      • setOpen

        public void setOpen​(boolean open)
        Sets whether this changeset is open.
        Parameters:
        open - true if this changeset is open
      • getMin

        public LatLon getMin()
        Returns the min lat/lon of the changeset bounding box.
        Returns:
        the min lat/lon of the changeset bounding box
      • setMin

        public void setMin​(LatLon min)
        Sets the min lat/lon of the changeset bounding box.
        Parameters:
        min - min lat/lon of the changeset bounding box
      • getMax

        public LatLon getMax()
        Returns the max lat/lon of the changeset bounding box.
        Returns:
        the max lat/lon of the changeset bounding box
      • setMax

        public void setMax​(LatLon max)
        Sets the max lat/lon of the changeset bounding box.
        Parameters:
        max - min lat/lon of the changeset bounding box
      • getBounds

        public Bounds getBounds()
        Returns the changeset bounding box.
        Returns:
        the changeset bounding box
      • getComment

        public String getComment()
        Replies this changeset comment.
        Returns:
        this changeset comment (empty string if missing)
        Since:
        12494
      • getCommentsCount

        public int getCommentsCount()
        Replies the number of comments for this changeset discussion.
        Returns:
        the number of comments for this changeset discussion
        Since:
        7700
      • setCommentsCount

        public void setCommentsCount​(int commentsCount)
        Sets the number of comments for this changeset discussion.
        Parameters:
        commentsCount - the number of comments for this changeset discussion
        Since:
        7700
      • getChangesCount

        public int getChangesCount()
        Replies the number of changes for this changeset.
        Returns:
        the number of changes for this changeset
        Since:
        14231
      • setChangesCount

        public void setChangesCount​(int changesCount)
        Sets the number of changes for this changeset.
        Parameters:
        changesCount - the number of changes for this changeset
        Since:
        14231
      • getKeys

        public Map<String,​StringgetKeys()
        Description copied from interface: Tagged
        Replies the map of key/value pairs. Never null, but may be the empty map.
        Specified by:
        getKeys in interface Tagged
        Returns:
        the map of key/value pairs
      • setKeys

        public void setKeys​(Map<String,​String> keys)
        Description copied from interface: Tagged
        Sets the map of key/value pairs
        Specified by:
        setKeys in interface Tagged
        Parameters:
        keys - the map of key value pairs. If null, reset to the empty map.
      • isIncomplete

        public boolean isIncomplete()
        Determines if this changeset is incomplete.
        Returns:
        true if this changeset is incomplete
      • setIncomplete

        public void setIncomplete​(boolean incomplete)
        Sets whether this changeset is incomplete
        Parameters:
        incomplete - true if this changeset is incomplete
      • put

        public void put​(String key,
                        String value)
        Description copied from interface: Tagged
        Sets a key/value pairs
        Specified by:
        put in interface Tagged
        Parameters:
        key - the key
        value - the value. If null, removes the key/value pair.
      • get

        public String get​(String key)
        Description copied from interface: Tagged
        Replies the value of the given key; null, if there is no value for this key
        Specified by:
        get in interface Tagged
        Parameters:
        key - the key
        Returns:
        the value
      • remove

        public void remove​(String key)
        Description copied from interface: Tagged
        Removes a given key/value pair
        Specified by:
        remove in interface Tagged
        Parameters:
        key - the key
      • hasEqualSemanticAttributes

        public boolean hasEqualSemanticAttributes​(Changeset other)
        Determines if this changeset has equals semantic attributes with another one.
        Parameters:
        other - other changeset
        Returns:
        true if this changeset has equals semantic attributes with other changeset
      • hasKeys

        public boolean hasKeys()
        Description copied from interface: Tagged
        Replies true, if there is at least one key/value pair; false, otherwise
        Specified by:
        hasKeys in interface Tagged
        Returns:
        true, if there is at least one key/value pair; false, otherwise
      • getNumKeys

        public int getNumKeys()
        Description copied from interface: Tagged
        Gets the number of keys
        Specified by:
        getNumKeys in interface Tagged
        Returns:
        The number of keys set for this tagged object.
      • isNew

        public boolean isNew()
        Determines if this changeset is new.
        Returns:
        true if this changeset is new (id <= 0)
      • mergeFrom

        public void mergeFrom​(Changeset other)
        Merges changeset metadata from another changeset.
        Parameters:
        other - other changeset
      • hasContent

        public boolean hasContent()
        Determines if this changeset has contents.
        Returns:
        true if this changeset has contents
      • setContent

        public void setContent​(ChangesetDataSet content)
        Sets the changeset contents.
        Parameters:
        content - changeset contents, can be null
      • getDiscussion

        public List<ChangesetDiscussionCommentgetDiscussion()
        Replies the list of comments in the changeset discussion, if any.
        Returns:
        the list of comments in the changeset discussion. May be empty but never null
        Since:
        7704