X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2FSoneProvider.java;h=993804f55ba31222e4b50c809362f2fe253278ba;hp=b1b1eb48dadce65252659879e3da7d79f5a2fe22;hb=10fa1478fef15624a873c0878ed017603742bcfe;hpb=8f02544d31f323ae9053dd9a11a99eacd8cf5bcd diff --git a/src/main/java/net/pterodactylus/sone/database/SoneProvider.java b/src/main/java/net/pterodactylus/sone/database/SoneProvider.java index b1b1eb4..993804f 100644 --- a/src/main/java/net/pterodactylus/sone/database/SoneProvider.java +++ b/src/main/java/net/pterodactylus/sone/database/SoneProvider.java @@ -17,8 +17,12 @@ package net.pterodactylus.sone.database; +import java.util.Collection; + import net.pterodactylus.sone.data.Sone; +import com.google.common.base.Optional; + /** * Interface for objects that can provide {@link Sone}s by their ID. * @@ -27,12 +31,34 @@ import net.pterodactylus.sone.data.Sone; 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 - * @return The Sone with the given ID, or {@code null} + * @return The Sone with the given ID, or {@link Optional#absent()} + */ + public Optional getSone(String soneId); + + /** + * Returns all Sones. + * + * @return All Sones + */ + public Collection getSones(); + + /** + * Returns all local Sones. + * + * @return All local Sones + */ + public Collection getLocalSones(); + + /** + * Returns all remote Sones. + * + * @return All remote Sones */ - public Sone getSone(String soneId); + public Collection getRemoteSones(); }