projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e63f465
)
Add method to tell if a post has already been loaded.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Sun, 9 Nov 2014 10:55:38 +0000
(11:55 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Sat, 22 Nov 2014 11:38:19 +0000
(12:38 +0100)
src/main/java/net/pterodactylus/sone/data/Post.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/sone/data/Post.java
b/src/main/java/net/pterodactylus/sone/data/Post.java
index
63d4b77
..
09198fd
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/Post.java
+++ b/
src/main/java/net/pterodactylus/sone/data/Post.java
@@
-62,6
+62,14
@@
public interface Post extends Identified {
public String getId();
/**
+ * Returns whether this post has already been loaded.
+ *
+ * @return {@code true} if this post has already been loaded, {@code
+ * false} otherwise
+ */
+ boolean isLoaded();
+
+ /**
* Returns the Sone this post belongs to.
*
* @return The Sone of this post
diff --git
a/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
b/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
index
2d25715
..
4e6f6ba
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
@@
-91,6
+91,11
@@
public class PostImpl implements Post {
return id.toString();
}
+ @Override
+ public boolean isLoaded() {
+ return true;
+ }
+
/**
* {@inheritDoc}
*/
diff --git
a/src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java
b/src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java
index
22fa7e6
..
180cf6c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java
+++ b/
src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java
@@
-94,6
+94,11
@@
class MemoryPost implements Post {
return id.toString();
}
+ @Override
+ public boolean isLoaded() {
+ return true;
+ }
+
/**
* {@inheritDoc}
*/