diff --git a/lib/src/main/java/tech/favware/java8_result/Result.java b/lib/src/main/java/tech/favware/java8_result/Result.java index 52f4909..453e3c8 100644 --- a/lib/src/main/java/tech/favware/java8_result/Result.java +++ b/lib/src/main/java/tech/favware/java8_result/Result.java @@ -81,6 +81,9 @@ static Result ofOptional(Optional op) { return ofOptional(op, new IllegalArgumentException("Missing Value")); } + /** + * @return true if the {@link Result} is {@link Ok} + */ boolean isOk(); /** diff --git a/lib/src/main/java/tech/favware/java8_result/ResultMapFunction.java b/lib/src/main/java/tech/favware/java8_result/ResultMapFunction.java index b03852f..9c06f53 100644 --- a/lib/src/main/java/tech/favware/java8_result/ResultMapFunction.java +++ b/lib/src/main/java/tech/favware/java8_result/ResultMapFunction.java @@ -1,7 +1,16 @@ package tech.favware.java8_result; +/** + * @param the type of the input to the function + * @param the type of the result of the function + */ public interface ResultMapFunction { + /** + * @param t the input argument + * @return the result of the function + * @throws Throwable the type of throwable thrown by this method + */ @SuppressWarnings("java:S112") R apply(T t) throws Throwable; } diff --git a/lib/src/main/java/tech/favware/java8_result/ResultSupplier.java b/lib/src/main/java/tech/favware/java8_result/ResultSupplier.java index 9b77669..bd0c910 100644 --- a/lib/src/main/java/tech/favware/java8_result/ResultSupplier.java +++ b/lib/src/main/java/tech/favware/java8_result/ResultSupplier.java @@ -8,6 +8,10 @@ */ public interface ResultSupplier { + /** + * @return the result of the operation + * @throws Throwable the type of throwable thrown by this method + */ @SuppressWarnings("java:S112") T get() throws Throwable; } \ No newline at end of file