/*
- * FreenetSone - StatusUpdate.java - Copyright © 2010 David Roden
+ * Sone - Post.java - Copyright © 2010 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
import java.util.Comparator;
import java.util.UUID;
+import net.pterodactylus.util.filter.Filter;
+
/**
* A post is a short message that a user writes in his Sone to let other users
* know what is going on.
};
+ /** Filter for posts with timestamps from the future. */
+ public static final Filter<Post> FUTURE_POSTS_FILTER = new Filter<Post>() {
+
+ @Override
+ public boolean filterObject(Post post) {
+ return post.getTime() <= System.currentTimeMillis();
+ }
+
+ };
+
/** The GUID of the post. */
private final UUID id;
/** The text of the post. */
private volatile String text;
+ /** Whether the post is known. */
+ private volatile boolean known;
+
/**
* Creates a new post.
*
return this;
}
+ /**
+ * Returns whether this post is known.
+ *
+ * @return {@code true} if this post is known, {@code false} otherwise
+ */
+ public boolean isKnown() {
+ return known;
+ }
+
+ /**
+ * Sets whether this post is known.
+ *
+ * @param known
+ * {@code true} if this post is known, {@code false} otherwise
+ * @return This post
+ */
+ public Post setKnown(boolean known) {
+ this.known = known;
+ return this;
+ }
+
//
// OBJECT METHODS
//