package net.pterodactylus.sone.core;
-import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
.getValue(defaultValue);
}
- public Collection<Post> parsePosts(PostBuilderFactory postBuilderFactory)
+ public Set<Post> parsePosts(PostBuilderFactory postBuilderFactory)
throws InvalidPostFound {
Set<Post> posts = new HashSet<Post>();
while (true) {
return (postRecipientId != null) && (postRecipientId.length() == 43);
}
- public Collection<PostReply> parsePostReplies(
+ public Set<PostReply> parsePostReplies(
PostReplyBuilderFactory postReplyBuilderFactory) {
Set<PostReply> replies = new HashSet<PostReply>();
while (true) {
return replies;
}
+ public Set<String> parseLikedPostIds() {
+ Set<String> likedPostIds = new HashSet<String>();
+ while (true) {
+ String likedPostId =
+ getString("/Likes/Post/" + likedPostIds.size() + "/ID",
+ null);
+ if (likedPostId == null) {
+ break;
+ }
+ likedPostIds.add(likedPostId);
+ }
+ return likedPostIds;
+ }
+
+ public Set<String> parseLikedPostReplyIds() {
+ Set<String> likedPostReplyIds = new HashSet<String>();
+ while (true) {
+ String likedReplyId = getString(
+ "/Likes/Reply/" + likedPostReplyIds.size() + "/ID", null);
+ if (likedReplyId == null) {
+ break;
+ }
+ likedPostReplyIds.add(likedReplyId);
+ }
+ return likedPostReplyIds;
+ }
+
+ public Set<String> parseFriends() {
+ Set<String> friends = new HashSet<String>();
+ while (true) {
+ String friendId =
+ getString("/Friends/" + friends.size() + "/ID", null);
+ if (friendId == null) {
+ break;
+ }
+ friends.add(friendId);
+ }
+ return friends;
+ }
+
public static class InvalidPostFound extends RuntimeException { }
public static class InvalidPostReplyFound extends RuntimeException { }