From ebede056b159ea34d294f3fac0e2def790454a48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 13 Jul 2015 18:21:15 +0200 Subject: [PATCH] Inline interfaces used in ClientPut --- .../pterodactylus/fcp/quelaton/ClientPutCommand.java | 18 +++++++++++++++--- .../fcp/quelaton/ClientPutCommandImpl.java | 8 ++++---- .../net/pterodactylus/fcp/quelaton/WithLength.java | 14 -------------- .../java/net/pterodactylus/fcp/quelaton/WithUri.java | 14 -------------- 4 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java delete mode 100644 src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java index 41c2377..7e900f2 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java @@ -16,8 +16,20 @@ public interface ClientPutCommand { ClientPutCommand onKeyGenerated(Consumer keyGenerated); ClientPutCommand named(String targetFilename); - WithUri>> redirectTo(String uri); - WithUri>> from(File file); - WithLength>>> from(InputStream inputStream); + WithUri redirectTo(String uri); + WithUri from(File file); + WithLength from(InputStream inputStream); + + interface WithLength { + + WithUri length(long length); + + } + + interface WithUri { + + Executable> uri(String uri); + + } } diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java index 1b322f3..06d54e0 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java @@ -66,24 +66,24 @@ class ClientPutCommandImpl implements ClientPutCommand { } @Override - public WithUri>> redirectTo(String uri) { + public WithUri redirectTo(String uri) { this.redirectUri.set(Objects.requireNonNull(uri, "uri must not be null")); return this::key; } @Override - public WithUri>> from(File file) { + public WithUri from(File file) { this.file.set(Objects.requireNonNull(file, "file must not be null")); return this::key; } @Override - public WithLength>>> from(InputStream inputStream) { + public WithLength from(InputStream inputStream) { payload.set(Objects.requireNonNull(inputStream, "inputStream must not be null")); return this::length; } - private WithUri>> length(long length) { + private WithUri length(long length) { this.length.set(length); return this::key; } diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java b/src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java deleted file mode 100644 index 8d38bf3..0000000 --- a/src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.pterodactylus.fcp.quelaton; - -/** - * An intermediary interface for FCP commands that require a length parameter. - * - * @param - * The type of the next command part - * @author David ‘Bombe’ Roden - */ -public interface WithLength { - - R length(long length); - -} diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java b/src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java deleted file mode 100644 index daaae52..0000000 --- a/src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.pterodactylus.fcp.quelaton; - -/** - * The terminal operation of an FCP command, requiring a Freenet URI. - * - * @param - * The type of the command result - * @author David ‘Bombe’ Roden - */ -public interface WithUri { - - R uri(String uri); - -} -- 2.7.4