aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client/SearchArgument.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-08-11 23:28:33 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-08-11 23:28:33 +0800
commit28025895e0da1e6079264dbfe951e7fd9bf069d8 (patch)
treebd28e2f6bf02a2806c4b7802fac912ed43444e43 /src/main/java/me/shedaniel/rei/client/SearchArgument.java
parent019aa13875ca639dda2f34c66e3160f72b923cfd (diff)
downloadRoughlyEnoughItems-28025895e0da1e6079264dbfe951e7fd9bf069d8.tar.gz
RoughlyEnoughItems-28025895e0da1e6079264dbfe951e7fd9bf069d8.tar.bz2
RoughlyEnoughItems-28025895e0da1e6079264dbfe951e7fd9bf069d8.zip
Scrollable Entry List?
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/SearchArgument.java')
-rw-r--r--src/main/java/me/shedaniel/rei/client/SearchArgument.java58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/SearchArgument.java b/src/main/java/me/shedaniel/rei/client/SearchArgument.java
deleted file mode 100644
index 2cf8ef415..000000000
--- a/src/main/java/me/shedaniel/rei/client/SearchArgument.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.client;
-
-import java.util.Locale;
-import java.util.function.Function;
-
-public class SearchArgument {
-
- public static final SearchArgument ALWAYS = new SearchArgument(ArgumentType.ALWAYS, "", true);
- private ArgumentType argumentType;
- private String text;
- public final Function<String, Boolean> INCLUDE = s -> s.contains(text);
- public final Function<String, Boolean> NOT_INCLUDE = s -> !s.contains(text);
- private boolean include;
-
- public SearchArgument(ArgumentType argumentType, String text, boolean include) {
- this(argumentType, text, include, true);
- }
-
- public SearchArgument(ArgumentType argumentType, String text, boolean include, boolean autoLowerCase) {
- this.argumentType = argumentType;
- this.text = autoLowerCase ? text.toLowerCase(Locale.ROOT) : text;
- this.include = include;
- }
-
- public Function<String, Boolean> getFunction(boolean include) {
- return include ? INCLUDE : NOT_INCLUDE;
- }
-
- public ArgumentType getArgumentType() {
- return argumentType;
- }
-
- public String getText() {
- return text;
- }
-
- public boolean isInclude() {
- return include;
- }
-
- @Override
- public String toString() {
- return String.format("Argument[%s]: name = %s, include = %b", argumentType.name(), text, include);
- }
-
- public enum ArgumentType {
- TEXT,
- MOD,
- TOOLTIP,
- ALWAYS
- }
-
-}