Remove @author tags
[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 import com.google.common.base.Objects;
22
23 /**
24  * {@link Sone} implementation that only stores the ID of a Sone and returns
25  * {@code null}, {@code 0}, or empty collections where appropriate.
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 Sone setTime(long time) {
76                 return null;
77         }
78
79         @Override
80         public SoneStatus getStatus() {
81                 return null;
82         }
83
84         @Override
85         public Sone setStatus(SoneStatus status) {
86                 return null;
87         }
88
89         @Override
90         public Profile getProfile() {
91                 return new Profile(this);
92         }
93
94         @Override
95         public void setProfile(Profile profile) {
96         }
97
98         @Override
99         public Client getClient() {
100                 return null;
101         }
102
103         @Override
104         public Sone setClient(Client client) {
105                 return null;
106         }
107
108         @Override
109         public boolean isKnown() {
110                 return false;
111         }
112
113         @Override
114         public Sone setKnown(boolean known) {
115                 return null;
116         }
117
118         @Override
119         public List<String> getFriends() {
120                 return emptyList();
121         }
122
123         @Override
124         public boolean hasFriend(String friendSoneId) {
125                 return false;
126         }
127
128         @Override
129         public List<Post> getPosts() {
130                 return emptyList();
131         }
132
133         @Override
134         public Sone setPosts(Collection<Post> posts) {
135                 return this;
136         }
137
138         @Override
139         public void addPost(Post post) {
140         }
141
142         @Override
143         public void removePost(Post post) {
144         }
145
146         @Override
147         public Set<PostReply> getReplies() {
148                 return emptySet();
149         }
150
151         @Override
152         public Sone setReplies(Collection<PostReply> replies) {
153                 return this;
154         }
155
156         @Override
157         public void addReply(PostReply reply) {
158         }
159
160         @Override
161         public void removeReply(PostReply reply) {
162         }
163
164         @Override
165         public Set<String> getLikedPostIds() {
166                 return emptySet();
167         }
168
169         @Override
170         public Sone setLikePostIds(Set<String> likedPostIds) {
171                 return this;
172         }
173
174         @Override
175         public boolean isLikedPostId(String postId) {
176                 return false;
177         }
178
179         @Override
180         public Sone addLikedPostId(String postId) {
181                 return this;
182         }
183
184         @Override
185         public void removeLikedPostId(String postId) {
186         }
187
188         @Override
189         public Set<String> getLikedReplyIds() {
190                 return emptySet();
191         }
192
193         @Override
194         public Sone setLikeReplyIds(Set<String> likedReplyIds) {
195                 return this;
196         }
197
198         @Override
199         public boolean isLikedReplyId(String replyId) {
200                 return false;
201         }
202
203         @Override
204         public Sone addLikedReplyId(String replyId) {
205                 return this;
206         }
207
208         @Override
209         public void removeLikedReplyId(String replyId) {
210         }
211
212         @Override
213         public Album getRootAlbum() {
214                 return null;
215         }
216
217         @Override
218         public SoneOptions getOptions() {
219                 return null;
220         }
221
222         @Override
223         public void setOptions(SoneOptions options) {
224         }
225
226         @Override
227         public int compareTo(Sone o) {
228                 return 0;
229         }
230
231         @Override
232         public String getFingerprint() {
233                 return null;
234         }
235
236         @Override
237         public String getId() {
238                 return id;
239         }
240
241         @Override
242         public int hashCode() {
243                 return id.hashCode();
244         }
245
246         @Override
247         public boolean equals(Object object) {
248                 return (object != null) && (object.getClass() == getClass()) && Objects.equal(id, ((IdOnlySone) object).id);
249         }
250
251 }