projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🎨 Use Java’s predicate instead of Guava’s
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
utils
/
DefaultOption.java
diff --git
a/src/main/java/net/pterodactylus/sone/utils/DefaultOption.java
b/src/main/java/net/pterodactylus/sone/utils/DefaultOption.java
index
d9acaeb
..
b46c58e
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/utils/DefaultOption.java
+++ b/
src/main/java/net/pterodactylus/sone/utils/DefaultOption.java
@@
-1,6
+1,6
@@
package net.pterodactylus.sone.utils;
package net.pterodactylus.sone.utils;
-import
com.google.common.base
.Predicate;
+import
java.util.function
.Predicate;
/**
* Basic implementation of an {@link Option}.
/**
* Basic implementation of an {@link Option}.
@@
-66,7
+66,7
@@
public class DefaultOption<T> implements Option<T> {
*/
@Override
public boolean validate(T value) {
*/
@Override
public boolean validate(T value) {
- return (validator == null) || (value == null) || validator.
apply
(value);
+ return (validator == null) || (value == null) || validator.
test
(value);
}
/**
}
/**
@@
-74,7
+74,7
@@
public class DefaultOption<T> implements Option<T> {
*/
@Override
public void set(T 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;
throw new IllegalArgumentException("New Value (" + value + ") could not be validated.");
}
this.value = value;