Skip to content

Commit

Permalink
Make getCommentText @nonnull
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Mar 27, 2024
1 parent adcc1f1 commit c57016b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
public class CommentsInfoItem extends InfoItem {

private String commentId;
private Description commentText;
@Nonnull
private Description commentText = Description.EMPTY_DESCRIPTION;
private String uploaderName;
@Nonnull
private List<Image> uploaderAvatars = List.of();
Expand Down Expand Up @@ -50,11 +51,12 @@ public void setCommentId(final String commentId) {
this.commentId = commentId;
}

@Nonnull
public Description getCommentText() {
return commentText;
}

public void setCommentText(final Description commentText) {
public void setCommentText(@Nonnull final Description commentText) {
this.commentText = commentText;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ default String getTextualLikeCount() throws ParsingException {
/**
* The text of the comment
*/
@Nonnull
default Description getCommentText() throws ParsingException {
return Description.EMPTY_DESCRIPTION;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public List<Image> getThumbnails() throws ParsingException {
return getUploaderAvatars();
}

@Nonnull
@Override
public Description getCommentText() throws ParsingException {
return new Description(review.getString("why"), Description.PLAIN_TEXT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public DateWrapper getUploadDate() throws ParsingException {
return new DateWrapper(parseDateFrom(textualUploadDate));
}

@Nonnull
@Override
public Description getCommentText() throws ParsingException {
final String htmlText = JsonUtils.getString(item, "text");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public String getCommentId() {
return Objects.toString(json.getLong("id"), null);
}

@Nonnull
@Override
public Description getCommentText() {
return new Description(json.getString("body"), Description.PLAIN_TEXT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public String getTextualLikeCount() throws ParsingException {
}
}

@Nonnull
@Override
public Description getCommentText() throws ParsingException {
try {
Expand Down

0 comments on commit c57016b

Please sign in to comment.