X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FPost.java;h=bb431d04759a34112e4559804d2e10f67290803c;hp=964a05462047dfe79041ff2a7c110cce11e31e92;hb=73be50df4f7b7761fe7f286f2fdb73a142c14926;hpb=5777cb6291375cdd4cbc2c781d1fea807da566f8 diff --git a/src/main/java/net/pterodactylus/sone/data/Post.java b/src/main/java/net/pterodactylus/sone/data/Post.java index 964a054..bb431d0 100644 --- a/src/main/java/net/pterodactylus/sone/data/Post.java +++ b/src/main/java/net/pterodactylus/sone/data/Post.java @@ -20,6 +20,8 @@ package net.pterodactylus.sone.data; 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. @@ -38,6 +40,16 @@ public class Post { }; + /** Filter for posts with timestamps from the future. */ + public static final Filter FUTURE_POSTS_FILTER = new Filter() { + + @Override + public boolean filterObject(Post post) { + return post.getTime() <= System.currentTimeMillis(); + } + + }; + /** The GUID of the post. */ private final UUID id;