public Sone getSone();
/**
- * Returns whether this post has a recipient.
- *
- * @return {@code true} if this post has a recipient, {@code false}
- * otherwise
- */
- public boolean hasRecipient();
-
- /**
* Returns the ID of the recipient {@link Sone}, or
* {@link Optional#absent()} if this post does not have a recipient.
*
* {@inheritDocs}
*/
@Override
- public boolean hasRecipient() {
- return recipientId != null;
- }
-
- /**
- * {@inheritDocs}
- */
- @Override
public Optional<String> getRecipientId() {
return Optional.fromNullable(recipientId);
}
postBuilder.put(prefix + "ID", post.getId());
postBuilder.put(prefix + "Sone", post.getSone().getId());
- if (post.hasRecipient()) {
+ if (post.getRecipientId().isPresent()) {
postBuilder.put(prefix + "Recipient", post.getRecipientId().get());
}
postBuilder.put(prefix + "Time", post.getTime());
<div class="inner-part">
<div<%if !post.loaded> class="hidden"<%/if>>
<div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
- <%if post.hasRecipient>
+ <%if post.recipientId.present>
<span class="recipient-to">→</span>
- <%ifnull post.recipient.orNull>
+ <%if !post.recipient.present>
<div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
<%else>
<div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><% post.recipient.get.niceName|html></a></div>