Commit 2e120f75 authored by akwizgran's avatar akwizgran

Add parameterised return type.

parent 031eac54
......@@ -21,7 +21,7 @@ public class BlogInvitationRequest extends InvitationRequest<Blog> {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitBlogInvitatioRequest(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitBlogInvitationRequest(this);
}
}
......@@ -18,7 +18,7 @@ public class BlogInvitationResponse extends InvitationResponse {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitBlogInvitationResponse(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitBlogInvitationResponse(this);
}
}
......@@ -23,7 +23,7 @@ public class ForumInvitationRequest extends InvitationRequest<Forum> {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitForumInvitationRequest(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitForumInvitationRequest(this);
}
}
......@@ -21,7 +21,7 @@ public class ForumInvitationResponse extends InvitationResponse {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitForumInvitationResponse(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitForumInvitationResponse(this);
}
}
......@@ -31,7 +31,7 @@ public class IntroductionRequest extends PrivateRequest<Author> {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitIntroductionRequest(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitIntroductionRequest(this);
}
}
......@@ -37,7 +37,7 @@ public class IntroductionResponse extends PrivateResponse {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitIntroductionResponse(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitIntroductionResponse(this);
}
}
......@@ -54,7 +54,7 @@ public class PrivateMessageHeader {
return read;
}
public void accept(PrivateMessageVisitor v) {
v.visitPrivateMessageHeader(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitPrivateMessageHeader(this);
}
}
package org.briarproject.briar.api.messaging;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.blog.BlogInvitationRequest;
import org.briarproject.briar.api.blog.BlogInvitationResponse;
import org.briarproject.briar.api.forum.ForumInvitationRequest;
......@@ -9,23 +10,24 @@ import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
public interface PrivateMessageVisitor {
@NotNullByDefault
public interface PrivateMessageVisitor<T> {
void visitPrivateMessageHeader(PrivateMessageHeader h);
T visitPrivateMessageHeader(PrivateMessageHeader h);
void visitBlogInvitatioRequest(BlogInvitationRequest r);
T visitBlogInvitationRequest(BlogInvitationRequest r);
void visitBlogInvitationResponse(BlogInvitationResponse r);
T visitBlogInvitationResponse(BlogInvitationResponse r);
void visitForumInvitationRequest(ForumInvitationRequest r);
T visitForumInvitationRequest(ForumInvitationRequest r);
void visitForumInvitationResponse(ForumInvitationResponse r);
T visitForumInvitationResponse(ForumInvitationResponse r);
void visitGroupInvitationRequest(GroupInvitationRequest r);
T visitGroupInvitationRequest(GroupInvitationRequest r);
void visitGroupInvitationResponse(GroupInvitationResponse r);
T visitGroupInvitationResponse(GroupInvitationResponse r);
void visitIntroductionRequest(IntroductionRequest r);
T visitIntroductionRequest(IntroductionRequest r);
void visitIntroductionResponse(IntroductionResponse r);
T visitIntroductionResponse(IntroductionResponse r);
}
......@@ -24,7 +24,7 @@ public class GroupInvitationRequest extends InvitationRequest<PrivateGroup> {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitGroupInvitationRequest(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitGroupInvitationRequest(this);
}
}
......@@ -21,7 +21,7 @@ public class GroupInvitationResponse extends InvitationResponse {
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitGroupInvitationResponse(this);
public <T> T accept(PrivateMessageVisitor<T> v) {
return v.visitGroupInvitationResponse(this);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment