package net.pterodactylus.sone.notify;
-import java.util.function.Predicate;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Singleton;
*/
@Override
public boolean isPostVisible(@Nullable Sone sone, @Nonnull Post post) {
- checkNotNull(post, "post must not be null");
if (!post.isLoaded()) {
return false;
}
return post.getTime() <= System.currentTimeMillis();
}
- @Override
- @Nonnull
- public Predicate<Post> isVisible(@Nullable final Sone currentSone) {
- return post -> (post != null) && isPostVisible(currentSone, post);
- }
-
}