package net.pterodactylus.sone.utils;
-import com.google.common.base.Predicate;
+import java.util.function.Predicate;
/**
* Basic implementation of an {@link Option}.
*
* @param <T>
* The type of the option
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class DefaultOption<T> implements Option<T> {
*/
@Override
public boolean validate(T value) {
- return (validator == null) || (value == null) || validator.apply(value);
+ return (validator == null) || (value == null) || validator.test(value);
}
/**
*/
@Override
public void set(T value) {
- if ((value != null) && (validator != null) && (!validator.apply(value))) {
+ if ((value != null) && (validator != null) && (!validator.test(value))) {
throw new IllegalArgumentException("New Value (" + value + ") could not be validated.");
}
this.value = value;