Dead code

This commit is contained in:
themode 2022-02-21 22:04:05 +01:00
parent b1353c69fe
commit dab6ec6000
5 changed files with 0 additions and 59 deletions

View File

@ -1,7 +0,0 @@
package net.minestom.server.utils.callback.validator;
import net.minestom.server.entity.Entity;
@FunctionalInterface
public interface EntityValidator extends Validator<Entity> {
}

View File

@ -1,7 +0,0 @@
package net.minestom.server.utils.callback.validator;
import net.minestom.server.entity.Player;
@FunctionalInterface
public interface PlayerValidator extends Validator<Player> {
}

View File

@ -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[]> {
}

View File

@ -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> {
}

View File

@ -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);
}
}
}