ce224fd1806dc941caeda63538d2927c30372d2e
[Sone.git] / src / main / java / net / pterodactylus / sone / data / impl / IdOnlySone.java
1 package net.pterodactylus.sone.data.impl;
2
3 import static java.util.Collections.emptyList;
4 import static java.util.Collections.emptySet;
5
6 import java.util.Collection;
7 import java.util.List;
8 import java.util.Set;
9
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;
18
19 import freenet.keys.FreenetURI;
20
21 /**
22  * {@link Sone} implementation that only stores the ID of a Sone and returns
23  * {@code null}, {@code 0}, or empty collections where appropriate.
24  *
25  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
26  */
27 public class IdOnlySone implements Sone {
28
29         private final String id;
30
31         public IdOnlySone(String id) {
32                 this.id = id;
33         }
34
35         @Override
36         public Identity getIdentity() {
37                 return null;
38         }
39
40         @Override
41         public String getName() {
42                 return id;
43         }
44
45         @Override
46         public boolean isLocal() {
47                 return false;
48         }
49
50         @Override
51         public FreenetURI getRequestUri() {
52                 return null;
53         }
54
55         @Override
56         public FreenetURI getInsertUri() {
57                 return null;
58         }
59
60         @Override
61         public long getLatestEdition() {
62                 return 0;
63         }
64
65         @Override
66         public void setLatestEdition(long latestEdition) {
67         }
68
69         @Override
70         public long getTime() {
71                 return 0;
72         }
73
74         @Override
75         public SoneStatus getStatus() {
76                 return null;
77         }
78
79         @Override
80         public Sone setStatus(SoneStatus status) {
81                 return null;
82         }
83
84         @Override
85         public Profile getProfile() {
86                 return new Profile(this);
87         }
88
89         @Override
90         public void setProfile(Profile profile) {
91         }
92
93         @Override
94         public Client getClient() {
95                 return null;
96         }
97
98         @Override
99         public boolean isKnown() {
100                 return false;
101         }
102
103         @Override
104         public Sone setKnown(boolean known) {
105                 return null;
106         }
107
108         @Override
109         public List<String> getFriends() {
110                 return emptyList();
111         }
112
113         @Override
114         public boolean hasFriend(String friendSoneId) {
115                 return false;
116         }
117
118         @Override
119         public List<Post> getPosts() {
120                 return emptyList();
121         }
122
123         @Override
124         public void addPost(Post post) {
125         }
126
127         @Override
128         public void removePost(Post post) {
129         }
130
131         @Override
132         public Set<PostReply> getReplies() {
133                 return emptySet();
134         }
135
136         @Override
137         public Sone setReplies(Collection<PostReply> replies) {
138                 return this;
139         }
140
141         @Override
142         public void addReply(PostReply reply) {
143         }
144
145         @Override
146         public void removeReply(PostReply reply) {
147         }
148
149         @Override
150         public Set<String> getLikedPostIds() {
151                 return emptySet();
152         }
153
154         @Override
155         public Sone setLikePostIds(Set<String> likedPostIds) {
156                 return this;
157         }
158
159         @Override
160         public boolean isLikedPostId(String postId) {
161                 return false;
162         }
163
164         @Override
165         public Sone addLikedPostId(String postId) {
166                 return this;
167         }
168
169         @Override
170         public Sone removeLikedPostId(String postId) {
171                 return this;
172         }
173
174         @Override
175         public Set<String> getLikedReplyIds() {
176                 return emptySet();
177         }
178
179         @Override
180         public Sone setLikeReplyIds(Set<String> likedReplyIds) {
181                 return this;
182         }
183
184         @Override
185         public boolean isLikedReplyId(String replyId) {
186                 return false;
187         }
188
189         @Override
190         public Sone addLikedReplyId(String replyId) {
191                 return this;
192         }
193
194         @Override
195         public Sone removeLikedReplyId(String replyId) {
196                 return this;
197         }
198
199         @Override
200         public Album getRootAlbum() {
201                 return null;
202         }
203
204         @Override
205         public SoneOptions getOptions() {
206                 return null;
207         }
208
209         @Override
210         public void setOptions(SoneOptions options) {
211         }
212
213         @Override
214         public int compareTo(Sone o) {
215                 return 0;
216         }
217
218         @Override
219         public String getFingerprint() {
220                 return null;
221         }
222
223         @Override
224         public String getId() {
225                 return id;
226         }
227
228 }