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 Sone setTime(long time) {
80 public SoneStatus getStatus() {
85 public Sone setStatus(SoneStatus status) {
90 public Profile getProfile() {
91 return new Profile(this);
95 public void setProfile(Profile profile) {
99 public Client getClient() {
104 public Sone setClient(Client client) {
109 public boolean isKnown() {
114 public Sone setKnown(boolean known) {
119 public List<String> getFriends() {
124 public boolean hasFriend(String friendSoneId) {
129 public Sone addFriend(String friendSone) {
134 public Sone removeFriend(String friendSoneId) {
139 public List<Post> getPosts() {
144 public Sone setPosts(Collection<Post> posts) {
149 public void addPost(Post post) {
153 public void removePost(Post post) {
157 public Set<PostReply> getReplies() {
162 public Sone setReplies(Collection<PostReply> replies) {
167 public void addReply(PostReply reply) {
171 public void removeReply(PostReply reply) {
175 public Set<String> getLikedPostIds() {
180 public Sone setLikePostIds(Set<String> likedPostIds) {
185 public boolean isLikedPostId(String postId) {
190 public Sone addLikedPostId(String postId) {
195 public Sone removeLikedPostId(String postId) {
200 public Set<String> getLikedReplyIds() {
205 public Sone setLikeReplyIds(Set<String> likedReplyIds) {
210 public boolean isLikedReplyId(String replyId) {
215 public Sone addLikedReplyId(String replyId) {
220 public Sone removeLikedReplyId(String replyId) {
225 public Album getRootAlbum() {
230 public SoneOptions getOptions() {
235 public void setOptions(SoneOptions options) {
239 public int compareTo(Sone o) {
244 public String getFingerprint() {
249 public String getId() {