/*
- * Sone - PostLinkPart.java - Copyright © 2011 David Roden
+ * Sone - PostPart.java - Copyright © 2011–2013 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
package net.pterodactylus.sone.text;
+import static com.google.common.base.Objects.equal;
+
import net.pterodactylus.sone.data.Post;
/**
// ACCESSORS
//
+ @Override
+ public boolean isPlainText() {
+ return false;
+ }
+
+ @Override
+ public boolean isFreenetLink() {
+ return false;
+ }
+
/**
* Returns the post referenced by this part.
*
return post;
}
+ //
+ // PART METHODS
+ //
+
+ @Override
+ public String getText() {
+ return post.getText();
+ }
+
+ @Override
+ public int hashCode() {
+ return getPost().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (!(object instanceof PostPart)) {
+ return false;
+ }
+ PostPart postPart = (PostPart) object;
+ return equal(getPost(), postPart.getPost());
+ }
+
}