projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make Sone returned by a Sone provider optional.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
database
/
SoneProvider.java
diff --git
a/src/main/java/net/pterodactylus/sone/database/SoneProvider.java
b/src/main/java/net/pterodactylus/sone/database/SoneProvider.java
index
b1b1eb4
..
bbe0abf
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/database/SoneProvider.java
+++ b/
src/main/java/net/pterodactylus/sone/database/SoneProvider.java
@@
-19,6
+19,8
@@
package net.pterodactylus.sone.database;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Sone;
+import com.google.common.base.Optional;
+
/**
* Interface for objects that can provide {@link Sone}s by their ID.
*
/**
* Interface for objects that can provide {@link Sone}s by their ID.
*
@@
-27,12
+29,13
@@
import net.pterodactylus.sone.data.Sone;
public interface SoneProvider {
/**
public interface SoneProvider {
/**
- * Returns the Sone with the given ID, if it exists.
+ * Returns the Sone with the given ID, or {@link Optional#absent()} if it
+ * does not exist.
*
* @param soneId
* The ID of the Sone to return
*
* @param soneId
* The ID of the Sone to return
- * @return The Sone with the given ID, or {@
code null
}
+ * @return The Sone with the given ID, or {@
link Optional#absent()
}
*/
*/
- public
Sone
getSone(String soneId);
+ public
Optional<Sone>
getSone(String soneId);
}
}