1 package net.pterodactylus.sone.data.impl;
3 import static java.util.Collections.emptyList;
4 import static java.util.Collections.emptySet;
6 import java.util.Collection;
10 import net.pterodactylus.sone.data.Album;
11 import net.pterodactylus.sone.data.Client;
12 import net.pterodactylus.sone.data.Post;
13 import net.pterodactylus.sone.data.PostReply;
14 import net.pterodactylus.sone.data.Profile;
15 import net.pterodactylus.sone.data.Sone;
16 import net.pterodactylus.sone.data.SoneOptions;
17 import net.pterodactylus.sone.freenet.wot.Identity;
19 import freenet.keys.FreenetURI;
22 * {@link Sone} implementation that only stores the ID of a Sone and returns
23 * {@code null}, {@code 0}, or empty collections where appropriate.
25 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
27 public class IdOnlySone implements Sone {
29 private final String id;
31 public IdOnlySone(String id) {
36 public Identity getIdentity() {
41 public String getName() {
46 public boolean isLocal() {
51 public FreenetURI getRequestUri() {
56 public FreenetURI getInsertUri() {
61 public long getLatestEdition() {
66 public void setLatestEdition(long latestEdition) {
70 public long getTime() {
75 public SoneStatus getStatus() {
80 public Sone setStatus(SoneStatus status) {
85 public Profile getProfile() {
86 return new Profile(this);
90 public void setProfile(Profile profile) {
94 public Client getClient() {
99 public boolean isKnown() {
104 public Sone setKnown(boolean known) {
109 public List<String> getFriends() {
114 public boolean hasFriend(String friendSoneId) {
119 public List<Post> getPosts() {
124 public Set<PostReply> getReplies() {
129 public Set<String> getLikedPostIds() {
134 public Sone setLikePostIds(Set<String> likedPostIds) {
139 public boolean isLikedPostId(String postId) {
144 public Sone addLikedPostId(String postId) {
149 public Sone removeLikedPostId(String postId) {
154 public Set<String> getLikedReplyIds() {
159 public Sone setLikeReplyIds(Set<String> likedReplyIds) {
164 public boolean isLikedReplyId(String replyId) {
169 public Sone addLikedReplyId(String replyId) {
174 public Sone removeLikedReplyId(String replyId) {
179 public Album getRootAlbum() {
184 public SoneOptions getOptions() {
189 public void setOptions(SoneOptions options) {
193 public int compareTo(Sone o) {
198 public String getFingerprint() {
203 public String getId() {