// SONETEMPLATEPAGE METHODS
//
- /**
- * {@inheritDoc}
- */
@Override
@SuppressWarnings("synthetic-access")
protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
*/
private String getPostId(String phrase) {
String postId = phrase.startsWith("post://") ? phrase.substring(7) : phrase;
- return (webInterface.getCore().getPost(postId).isPresent()) ? postId : null;
+ return (webInterface.getCore().getDatabase().getPost(postId).isPresent()) ? postId : null;
}
/**
*/
private String getAlbumId(String phrase) {
String albumId = phrase.startsWith("album://") ? phrase.substring(8) : phrase;
- return (webInterface.getCore().getAlbum(albumId, false) != null) ? albumId : null;
+ return webInterface.getCore().getAlbum(albumId).isPresent() ? albumId : null;
}
/**
*/
private String getImageId(String phrase) {
String imageId = phrase.startsWith("image://") ? phrase.substring(8) : phrase;
- return (webInterface.getCore().getImage(imageId, false) != null) ? imageId : null;
+ return webInterface.getCore().getImage(imageId).isPresent() ? imageId : null;
}
/**
this.complete = complete;
}
- /**
- * {@inheritDoc}
- */
@Override
public String generateString(Sone sone) {
StringBuilder soneString = new StringBuilder();
*/
private class PostStringGenerator implements StringGenerator<Post> {
- /**
- * {@inheritDoc}
- */
@Override
public String generateString(Post post) {
StringBuilder postString = new StringBuilder();
// OBJECT METHODS
//
- /**
- * {@inheritDoc}
- */
@Override
public int hashCode() {
return phrase.hashCode() ^ ((optionality == Optionality.FORBIDDEN) ? (0xaaaaaaaa) : ((optionality == Optionality.REQUIRED) ? 0x55555555 : 0));
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean equals(Object object) {
if (!(object instanceof Phrase)) {
*/
private static class HitMapper<T> implements Function<Hit<T>, T> {
- /**
- * {@inheritDoc}
- */
@Override
public T apply(Hit<T> input) {
return input.getObject();