Skip to content
Snippets Groups Projects
Commit a6cf4c0e authored by Martin Vogel's avatar Martin Vogel
Browse files

#414 Add single overloaded methods for sending a submission directly without method chaining

parent 118c0975
No related branches found
No related tags found
2 merge requests!2#414 Remaining changes from MR,!1planning#414 Methoden Signaturen (Zwischenstand)
......@@ -16,6 +16,10 @@ public class TestRunner {
private static void senderSample() {
// straight call in one go
SenderClient.build().send(UUID.randomUUID(), Collections.emptyList());
SenderClient.build().send(UUID.randomUUID(), Collections.emptyList(), "some json or xml");
// Without data
SenderClient.build()
.withDestination(UUID.randomUUID())
......
......@@ -42,6 +42,12 @@ public class SenderClient extends Client {
* @return the upload step for attachments
*/
WithAttachments withDestination(UUID destinationId);
SubmissionResponse send(UUID destinationId, List<File> attachments, String data);
SubmissionResponse send(UUID destinationId, List<File> attachments, byte[] data);
SubmissionResponse send(UUID destinationId, List<File> attachments);
}
public interface WithAttachments {
......@@ -98,6 +104,29 @@ public class SenderClient extends Client {
return this;
}
@Override
public SubmissionResponse send(UUID destinationId, List<File> attachments, String data) {
return this.withDestination(destinationId)
.withAttachments(attachments)
.withData(data)
.submit();
}
@Override
public SubmissionResponse send(UUID destinationId, List<File> attachments, byte[] data) {
return this.withDestination(destinationId)
.withAttachments(attachments)
.withData(data)
.submit();
}
@Override
public SubmissionResponse send(UUID destinationId, List<File> attachments) {
return this.withDestination(destinationId)
.withAttachments(attachments)
.submit();
}
@Override
public Submit withData(String data) {
return withData(data.getBytes(StandardCharsets.UTF_8));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment