mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-16 06:04:47 +00:00
Annotate all the things
This commit is contained in:
63 files changed
+623
-369
No files matched your search
@@ -29,11 +29,14 @@ import java.util.function.Predicate;
|
||||
@StableAPI(since = "0.8.0")
|
||||
public interface ITargetedMod {
|
||||
|
||||
@StableAPI.Expose
|
||||
String getModName();
|
||||
|
||||
@StableAPI.Expose
|
||||
boolean isLoadInDevelopment();
|
||||
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
@StableAPI.Expose
|
||||
default boolean isMatchingJar(Path path) {
|
||||
String pathString = path.toString();
|
||||
String nameLowerCase = Files.getNameWithoutExtension(pathString).toLowerCase();
|
||||
@@ -41,18 +44,22 @@ public interface ITargetedMod {
|
||||
|
||||
return "jar".equals(fileExtension) && getCondition().test(nameLowerCase);
|
||||
}
|
||||
|
||||
@StableAPI.Expose
|
||||
Predicate<String> getCondition();
|
||||
|
||||
@StableAPI(since = "0.5.0")
|
||||
final class PredicateHelpers {
|
||||
@StableAPI.Expose
|
||||
public static Predicate<String> startsWith(String subString) {
|
||||
return (name) -> name.startsWith(subString.toLowerCase());
|
||||
}
|
||||
|
||||
@StableAPI.Expose
|
||||
public static Predicate<String> contains(String subString) {
|
||||
return (name) -> name.contains(subString.toLowerCase());
|
||||
}
|
||||
|
||||
@StableAPI.Expose
|
||||
public static Predicate<String> matches(String regex) {
|
||||
return (name) -> name.matches(regex);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user