Skip to content
This repository has been archived by the owner on Feb 23, 2018. It is now read-only.

Commit

Permalink
#17 add tostring to entity
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Nov 30, 2017
1 parent 9698fa0 commit ac3e857
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -501,24 +499,10 @@ public String toString() {
}
builder.append("advancedView=").append(advancedView).append(", ");
if (bookmarks != null) {
builder.append("bookmarks=").append(toString(bookmarks, maxLen)).append(", ");
builder.append("bookmarks=").append(bookmarks.toString()).append(", ");
}
if (favorites != null) {
builder.append("favorites=").append(toString(favorites, maxLen));
}
builder.append("]");
return builder.toString();
}

private String toString(Collection<?> collection, int maxLen) {
StringBuilder builder = new StringBuilder();
builder.append("[");
int i = 0;
for (Iterator<?> iterator = collection.iterator(); iterator.hasNext() && i < maxLen; i++) {
if (i > 0) {
builder.append(", ");
}
builder.append(iterator.next());
builder.append("favorites=").append(favorites.toString());
}
builder.append("]");
return builder.toString();
Expand Down

0 comments on commit ac3e857

Please sign in to comment.