X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FConfigurationSoneParser.java;h=99c1c9d0e6a29733e0fb655852c9518934c5ce24;hb=f4f21f18add10c6a1c95f70faf851f06920dc77b;hp=a29856bf33d4f11bd776631662df4b47564fbd04;hpb=066c47675194a5295a9861b1c9c289c44219a740;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/core/ConfigurationSoneParser.java b/src/main/java/net/pterodactylus/sone/core/ConfigurationSoneParser.java
index a29856b..99c1c9d 100644
--- a/src/main/java/net/pterodactylus/sone/core/ConfigurationSoneParser.java
+++ b/src/main/java/net/pterodactylus/sone/core/ConfigurationSoneParser.java
@@ -27,17 +27,15 @@ import net.pterodactylus.util.config.Configuration;
/**
* Parses a {@link Sone}âs data from a {@link Configuration}.
- *
- * @author David âBombeâ Roden
*/
public class ConfigurationSoneParser {
private final Configuration configuration;
private final Sone sone;
private final String sonePrefix;
- private final Map albums = new HashMap();
- private final List topLevelAlbums = new ArrayList();
- private final Map images = new HashMap();
+ private final Map albums = new HashMap<>();
+ private final List topLevelAlbums = new ArrayList<>();
+ private final Map images = new HashMap<>();
public ConfigurationSoneParser(Configuration configuration, Sone sone) {
this.configuration = configuration;
@@ -86,7 +84,7 @@ public class ConfigurationSoneParser {
public Set parsePosts(PostBuilderFactory postBuilderFactory)
throws InvalidPostFound {
- Set posts = new HashSet();
+ Set posts = new HashSet<>();
while (true) {
String postPrefix = "/Posts/" + posts.size();
String postId = getString(postPrefix + "/ID", null);
@@ -123,7 +121,7 @@ public class ConfigurationSoneParser {
public Set parsePostReplies(
PostReplyBuilderFactory postReplyBuilderFactory) {
- Set replies = new HashSet();
+ Set replies = new HashSet<>();
while (true) {
String replyPrefix = "/Replies/" + replies.size();
String replyId = getString(replyPrefix + "/ID", null);
@@ -149,7 +147,7 @@ public class ConfigurationSoneParser {
}
public Set parseLikedPostIds() {
- Set likedPostIds = new HashSet();
+ Set likedPostIds = new HashSet<>();
while (true) {
String likedPostId =
getString("/Likes/Post/" + likedPostIds.size() + "/ID",
@@ -163,7 +161,7 @@ public class ConfigurationSoneParser {
}
public Set parseLikedPostReplyIds() {
- Set likedPostReplyIds = new HashSet();
+ Set likedPostReplyIds = new HashSet<>();
while (true) {
String likedReplyId = getString(
"/Likes/Reply/" + likedPostReplyIds.size() + "/ID", null);
@@ -176,7 +174,7 @@ public class ConfigurationSoneParser {
}
public Set parseFriends() {
- Set friends = new HashSet();
+ Set friends = new HashSet<>();
while (true) {
String friendId =
getString("/Friends/" + friends.size() + "/ID", null);
@@ -201,8 +199,6 @@ public class ConfigurationSoneParser {
String albumDescription =
getString(albumPrefix + "/Description", null);
String albumParentId = getString(albumPrefix + "/Parent", null);
- String albumImageId =
- getString(albumPrefix + "/AlbumImage", null);
if ((albumTitle == null) || (albumDescription == null)) {
throw new InvalidAlbumFound();
}
@@ -213,7 +209,6 @@ public class ConfigurationSoneParser {
.modify()
.setTitle(albumTitle)
.setDescription(albumDescription)
- .setAlbumImage(albumImageId)
.update();
if (albumParentId != null) {
Album parentAlbum = albums.get(albumParentId);