Skip to content

Commit

Permalink
Merge pull request #525 from B0pol/rename
Browse files Browse the repository at this point in the history
rename getHeartedByCreator and getPinned to isPinned and isHeartedByC…
  • Loading branch information
TobiGr authored Jan 23, 2021
2 parents 10e8c54 + 2662cec commit c00ee75
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ public void setHeartedByUploader(boolean isHeartedByUploader) {
this.heartedByUploader = isHeartedByUploader;
}

public boolean getHeartedByUploader() {
public boolean isHeartedByUploader() {
return this.heartedByUploader;
}

public boolean getPinned() {
public boolean isPinned() {
return pinned;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public interface CommentsInfoItemExtractor extends InfoItemExtractor {
/**
* Whether the comment has been hearted by the uploader
*/
boolean getHeartedByUploader() throws ParsingException;
boolean isHeartedByUploader() throws ParsingException;

/**
* Whether the comment is pinned
*/
boolean getPinned() throws ParsingException;
boolean isPinned() throws ParsingException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public CommentsInfoItem extract(CommentsInfoItemExtractor extractor) throws Pars
}

try {
resultItem.setHeartedByUploader(extractor.getHeartedByUploader());
resultItem.setHeartedByUploader(extractor.isHeartedByUploader());
} catch (Exception e) {
addError(e);
}

try {
resultItem.setPinned(extractor.getPinned());
resultItem.setPinned(extractor.isPinned());
} catch (Exception e) {
addError(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public String getUploaderAvatarUrl() {
}

@Override
public boolean getHeartedByUploader() throws ParsingException {
public boolean isHeartedByUploader() throws ParsingException {
return false;
}

@Override
public boolean getPinned() throws ParsingException {
public boolean isPinned() throws ParsingException {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public String getUploaderAvatarUrl() {
}

@Override
public boolean getHeartedByUploader() throws ParsingException {
public boolean isHeartedByUploader() throws ParsingException {
return false;
}

@Override
public boolean getPinned() throws ParsingException {
public boolean isPinned() throws ParsingException {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ public String getUploaderAvatarUrl() throws ParsingException {
}

@Override
public boolean getHeartedByUploader() throws ParsingException {
public boolean isHeartedByUploader() throws ParsingException {
return json.has("creatorHeart");
}

@Override
public boolean getPinned() {
public boolean isPinned() {
return json.has("pinnedCommentBadge");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void testGetCommentsAllData() throws IOException, ExtractionException {
assertFalse(Utils.isBlank(c.getUrl()));
assertFalse(c.getLikeCount() < 0);
assertFalse(Utils.isBlank(c.getCommentText()));
if (c.getHeartedByUploader()) {
if (c.isHeartedByUploader()) {
heartedByUploader = true;
}
}
Expand Down Expand Up @@ -222,7 +222,7 @@ public void testGetCommentsAllData() throws IOException, ExtractionException {
assertFalse(Utils.isBlank(c.getCommentText()));
}

assertTrue("First comment isn't pinned", comments.getItems().get(0).getPinned());
assertTrue("First comment isn't pinned", comments.getItems().get(0).isPinned());
}
}
}

0 comments on commit c00ee75

Please sign in to comment.