mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-03-02 10:41:04 +01:00
Update FCommons dependency to 1.2.7
This commit is contained in:
parent
92bcda8f2d
commit
03689e208b
@ -5,7 +5,6 @@
|
||||
*/
|
||||
package me.filoghost.holographicdisplays.placeholder.parsing;
|
||||
|
||||
import me.filoghost.fcommons.collection.CollectionUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -24,10 +23,6 @@ public class StringWithPlaceholders {
|
||||
this.string = string;
|
||||
this.placeholderMatches = findPlaceholders(string);
|
||||
}
|
||||
|
||||
protected List<PlaceholderOccurrence> getPlaceholders() {
|
||||
return CollectionUtils.transform(placeholderMatches, match -> match.content);
|
||||
}
|
||||
|
||||
public boolean containsPlaceholders() {
|
||||
return placeholderMatches != null && !placeholderMatches.isEmpty();
|
||||
|
@ -10,6 +10,7 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ -47,7 +48,11 @@ class StringWithPlaceholdersTest {
|
||||
void parsing(String input, String expectedPluginName, String expectedIdentifier, String expectedArgument) {
|
||||
StringWithPlaceholders s = new StringWithPlaceholders(input);
|
||||
|
||||
List<PlaceholderOccurrence> placeholders = s.getPlaceholders();
|
||||
List<PlaceholderOccurrence> placeholders = new ArrayList<>();
|
||||
s.replacePlaceholders(occurrence -> {
|
||||
placeholders.add(occurrence); // Just save occurrences
|
||||
return null;
|
||||
});
|
||||
assertThat(placeholders).hasSize(1);
|
||||
|
||||
PlaceholderOccurrence placeholder = placeholders.get(0);
|
||||
|
Loading…
Reference in New Issue
Block a user