Skip to content

Commit 8b3b668

Browse files
committed
Rename LinkDetections to LinkDetection
1 parent f29093d commit 8b3b668

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadCreatedListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.togetherjava.tjbot.features.UserInteractor;
2222
import org.togetherjava.tjbot.features.componentids.ComponentIdGenerator;
2323
import org.togetherjava.tjbot.features.componentids.ComponentIdInteractor;
24-
import org.togetherjava.tjbot.features.utils.LinkDetections;
24+
import org.togetherjava.tjbot.features.utils.LinkDetection;
2525
import org.togetherjava.tjbot.features.utils.MessageUtils;
2626

2727
import java.time.Instant;
@@ -122,7 +122,7 @@ private RestAction<Message> createAIResponse(ThreadChannel threadChannel) {
122122

123123
private static boolean isContextSufficient(Message message) {
124124
return !MessageUtils.containsImage(message)
125-
&& !LinkDetections.containsLink(message.getContentRaw());
125+
&& !LinkDetection.containsLink(message.getContentRaw());
126126
}
127127

128128
private RestAction<Void> pinOriginalQuestion(ThreadChannel threadChannel) {

application/src/main/java/org/togetherjava/tjbot/features/tags/TagCommand.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.togetherjava.tjbot.features.CommandVisibility;
2020
import org.togetherjava.tjbot.features.SlashCommandAdapter;
21-
import org.togetherjava.tjbot.features.utils.LinkDetections;
21+
import org.togetherjava.tjbot.features.utils.LinkDetection;
2222
import org.togetherjava.tjbot.features.utils.LinkPreview;
2323
import org.togetherjava.tjbot.features.utils.LinkPreviews;
2424
import org.togetherjava.tjbot.features.utils.StringDistances;
@@ -94,10 +94,10 @@ public void onSlashCommand(SlashCommandInteractionEvent event) {
9494
.map(OptionMapping::getAsUser)
9595
.map(User::getAsMention);
9696

97-
List<String> links = LinkDetections
97+
List<String> links = LinkDetection
9898
.extractLinks(tagContent,
99-
Set.of(LinkDetections.LinkFilter.SUPPRESSED,
100-
LinkDetections.LinkFilter.NON_HTTP_SCHEME))
99+
Set.of(LinkDetection.LinkFilter.SUPPRESSED,
100+
LinkDetection.LinkFilter.NON_HTTP_SCHEME))
101101
.stream()
102102
.limit(Message.MAX_EMBED_COUNT - 1L)
103103
.toList();

application/src/main/java/org/togetherjava/tjbot/features/utils/LinkDetections.java renamed to application/src/main/java/org/togetherjava/tjbot/features/utils/LinkDetection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
/**
1212
* Utility class to detect links.
1313
*/
14-
public class LinkDetections {
14+
public class LinkDetection {
1515

1616
/**
1717
* Possible ways to filter a link.
1818
*
19-
* @see LinkDetections
19+
* @see LinkDetection
2020
*/
2121
public enum LinkFilter {
2222
/**
@@ -29,7 +29,7 @@ public enum LinkFilter {
2929
NON_HTTP_SCHEME
3030
}
3131

32-
private LinkDetections() {
32+
private LinkDetection() {
3333
throw new UnsupportedOperationException("Utility class");
3434
}
3535

application/src/main/java/org/togetherjava/tjbot/features/utils/LinkPreviews.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/**
2727
* Provides means to create previews of links. See
28-
* {@link LinkDetections#extractLinks(String, boolean, boolean)} and
28+
* {@link LinkDetection#extractLinks(String, boolean, boolean)} and
2929
* {@link #createLinkPreviews(List)}.
3030
*/
3131
public final class LinkPreviews {

0 commit comments

Comments
 (0)