mirror of https://github.com/Minestom/Minestom.git
Dead code
This commit is contained in:
parent
b1353c69fe
commit
dab6ec6000
|
@ -1,7 +0,0 @@
|
|||
package net.minestom.server.utils.callback.validator;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface EntityValidator extends Validator<Entity> {
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package net.minestom.server.utils.callback.validator;
|
||||
|
||||
import net.minestom.server.entity.Player;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PlayerValidator extends Validator<Player> {
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package net.minestom.server.utils.callback.validator;
|
||||
|
||||
/**
|
||||
* Interface used when a string array needs to be validated dynamically.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface StringArrayValidator extends Validator<String[]> {
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package net.minestom.server.utils.callback.validator;
|
||||
|
||||
/**
|
||||
* Interface used when a string needs to be validated dynamically.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface StringValidator extends Validator<String> {
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package net.minestom.server.utils.callback.validator;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* Interface used when a value needs to be validated dynamically.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface Validator<T> extends Predicate<T> {
|
||||
|
||||
/**
|
||||
* Gets if a value is valid based on a condition.
|
||||
*
|
||||
* @param value the value to check
|
||||
* @return true if the value is valid, false otherwise
|
||||
*/
|
||||
boolean isValid(@NotNull T value);
|
||||
|
||||
@Override
|
||||
default boolean test(T t) {
|
||||
if (t == null) {
|
||||
return false;
|
||||
} else {
|
||||
return this.isValid(t);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue