• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ekryd / sortgraphql / 2150

08 Apr 2024 05:09PM CUT coverage: 98.082%. Remained the same
2150

push

circleci

web-flow
Update dependency commons-io:commons-io to v2.16.1

818 of 834 relevant lines covered (98.08%)

0.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/sorter/src/main/java/sortgraphql/sort/DescriptionAndComments.java
1
package sortgraphql.sort;
2

3
import static java.util.Optional.ofNullable;
4

5
import graphql.language.Comment;
6
import java.util.List;
7
import java.util.Objects;
8
import java.util.Optional;
9
import java.util.stream.Collectors;
10

11
public class DescriptionAndComments {
1✔
12
  private List<String> comments = List.of();
1✔
13
  private String description;
14

15
  public void comments(List<Comment> commentList) {
16
    if (commentList == null) {
1✔
17
      return;
×
18
    }
19
    this.comments =
1✔
20
        commentList.stream()
1✔
21
            .map(Comment::getContent)
1✔
22
            .filter(Objects::nonNull)
1✔
23
            .filter(c -> !c.isBlank())
1✔
24
            .collect(Collectors.toList());
1✔
25
  }
1✔
26

27
  public void description(String description) {
28
    this.description = description;
1✔
29
  }
1✔
30

31
  public boolean isNullOrEmpty() {
32
    return (comments == null || comments.isEmpty())
1✔
33
        && (description == null || description.isEmpty());
1✔
34
  }
35

36
  public List<String> getComments() {
37
    return comments;
1✔
38
  }
39

40
  public Optional<String> getDescription() {
41
    return ofNullable(description);
1✔
42
  }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc