- public void updateUris(long latestEdition) {
- if ((requestUri != null) && (requestUri.getEdition() < latestEdition)) {
- requestUri = requestUri.setSuggestedEdition(latestEdition);
- }
- if ((insertUri != null) && (insertUri.getEdition() < latestEdition)) {
- insertUri = insertUri.setSuggestedEdition(latestEdition);
- }
- }
-
- //
- // PRIVATE METHODS
- //
-
- /**
- * Updates the editions of the request URI and the insert URI (if latter is
- * not {@code null}) with the greater edition of either one.
- */
- private void updateEditions() {
- long requestEdition = 0;
- if (requestUri != null) {
- requestEdition = requestUri.getEdition();
- }
- long insertEdition = 0;
- if (insertUri != null) {
- insertEdition = insertUri.getEdition();
- }
- updateUris(Math.max(requestEdition, insertEdition));
- }
-
- //
- // OBJECT METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object object) {
- if (!(object instanceof Sone)) {
- return false;
- }
- return ((Sone) object).id.equals(id);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return getClass().getName() + "[id=" + id + ",name=" + name + ",requestUri=" + requestUri + ",insertUri=" + insertUri + ",friends(" + friendSones.size() + "),posts(" + posts.size() + "),replies(" + replies.size() + ")]";
- }