Make getCommentText @Nonnull

pull/1162/head
Stypox 2024-03-27 15:26:06 +01:00
rodzic adcc1f17ee
commit c57016b79b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
6 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -13,7 +13,8 @@ import java.util.List;
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();
@ -50,11 +51,12 @@ public class CommentsInfoItem extends InfoItem {
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;
}

Wyświetl plik

@ -45,6 +45,7 @@ public interface CommentsInfoItemExtractor extends InfoItemExtractor {
/**
* The text of the comment
*/
@Nonnull
default Description getCommentText() throws ParsingException {
return Description.EMPTY_DESCRIPTION;
}

Wyświetl plik

@ -38,6 +38,7 @@ public class BandcampCommentsInfoItemExtractor implements CommentsInfoItemExtrac
return getUploaderAvatars();
}
@Nonnull
@Override
public Description getCommentText() throws ParsingException {
return new Description(review.getString("why"), Description.PLAIN_TEXT);

Wyświetl plik

@ -77,6 +77,7 @@ public class PeertubeCommentsInfoItemExtractor implements CommentsInfoItemExtrac
return new DateWrapper(parseDateFrom(textualUploadDate));
}
@Nonnull
@Override
public Description getCommentText() throws ParsingException {
final String htmlText = JsonUtils.getString(item, "text");

Wyświetl plik

@ -29,6 +29,7 @@ public class SoundcloudCommentsInfoItemExtractor implements CommentsInfoItemExtr
return Objects.toString(json.getLong("id"), null);
}
@Nonnull
@Override
public Description getCommentText() {
return new Description(json.getString("body"), Description.PLAIN_TEXT);

Wyświetl plik

@ -184,6 +184,7 @@ public class YoutubeCommentsInfoItemExtractor implements CommentsInfoItemExtract
}
}
@Nonnull
@Override
public Description getCommentText() throws ParsingException {
try {