From d764d0b4b89203d30fbd97c5ea414b4dee46d418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabr=C3=ADcio=20Cabral?= Date: Tue, 3 Nov 2020 22:38:00 -0300 Subject: [PATCH] #1445: Add type to ctor (PECS) --- src/main/java/org/cactoos/scalar/ScalarOf.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cactoos/scalar/ScalarOf.java b/src/main/java/org/cactoos/scalar/ScalarOf.java index 31ec8af4fa..ce89472253 100644 --- a/src/main/java/org/cactoos/scalar/ScalarOf.java +++ b/src/main/java/org/cactoos/scalar/ScalarOf.java @@ -31,8 +31,8 @@ /** * ScalarOf. * - * @param Element type - * @param Element type + * @param Input element type + * @param Output element type * @since 0.4 */ public final class ScalarOf extends ScalarEnvelope { @@ -56,9 +56,14 @@ public ScalarOf(final Runnable runnable, final T result) { * @param proc Encapsulated proc * @param ipt Input * @param result Result to return + * @param Input element type * @since 0.41 */ - public ScalarOf(final Proc proc, final X ipt, final T result) { + public ScalarOf( + final Proc proc, + final X ipt, + final T result + ) { this(new FuncOf<>(proc, result), ipt); } @@ -66,9 +71,10 @@ public ScalarOf(final Proc proc, final X ipt, final T result) { * Ctor. * @param fnc Encapsulated func * @param ipt Input + * @param Input element type * @since 0.41 */ - public ScalarOf(final Func fnc, final X ipt) { + public ScalarOf(final Func fnc, final X ipt) { this(() -> fnc.apply(ipt)); }