diff --git a/src/main/java/org/cactoos/io/Zip.java b/src/main/java/org/cactoos/io/Zip.java index 99a8d9d86a..02b34fd08b 100644 --- a/src/main/java/org/cactoos/io/Zip.java +++ b/src/main/java/org/cactoos/io/Zip.java @@ -36,8 +36,8 @@ /** * Zip files and directory. - *

- *

There is no thread-safety guarantee. + *
+ *
There is no thread-safety guarantee. * * @since 0.29 */ diff --git a/src/main/java/org/cactoos/scalar/AndWithIndex.java b/src/main/java/org/cactoos/scalar/AndWithIndex.java index 55f856bfd5..f0a76b7178 100644 --- a/src/main/java/org/cactoos/scalar/AndWithIndex.java +++ b/src/main/java/org/cactoos/scalar/AndWithIndex.java @@ -41,7 +41,7 @@ * {@link java.util.stream.Stream#forEach(java.util.function.Consumer)} * works, but with an index provided for each item:

* - *
+ * 
{@code
  * new UncheckedScalar<>(
  *     new AndWithIndex(
  *         new IterableOf<>("Mary", "John", "William", "Napkin"),
@@ -50,8 +50,8 @@
  *     )
  * ).value();
  * // will print "| idx #0: name: Mary | idx #1: name: John |
- * idx #2: name: William | idx #3: name: Napkin " to console
- * 
+ * // idx #2: name: William | idx #3: name: Napkin " to console + * }
* *

This class implements {@link Scalar}, which throws a checked * {@link Exception}. This may not be convenient in many cases. To make diff --git a/src/main/java/org/cactoos/scalar/Constant.java b/src/main/java/org/cactoos/scalar/Constant.java index 56ce7652ab..568e2fa559 100644 --- a/src/main/java/org/cactoos/scalar/Constant.java +++ b/src/main/java/org/cactoos/scalar/Constant.java @@ -37,13 +37,12 @@ * {@link Exception}. Despite that this class does NOT throw a checked * exception as it only returns a pre-computed value.

* - *

Example: - *

- *     final Scalar<String> constant = new Constant≶>("Value");
+ * 

Example:

+ *
{@code
+ *     final Scalar constant = new Constant<>("Value");
  *     System.out.print("Constant is always the same: ");
  *     System.out.println(constant.value() == constant.value());
- *   
- *

+ * }
* *

This class is thread-safe.

* diff --git a/src/main/java/org/cactoos/scalar/Reduced.java b/src/main/java/org/cactoos/scalar/Reduced.java index c0e4831d9a..3ad462ff12 100644 --- a/src/main/java/org/cactoos/scalar/Reduced.java +++ b/src/main/java/org/cactoos/scalar/Reduced.java @@ -32,34 +32,34 @@ /** * Reduces iterable via BiFunc. * - *
+ * 
{@code
  * new Reduced<>(
  *     (first, last) -> first + last,
  *     new IterableOf<>(() -> 1L, () -> 2L, () -> 3L, () -> 4L)
  * ).value() // returns 10L
- * 
+ * }
* *

Here is how you can use it to * find one of items according to the specified {@link BiFunc}:

* - *
- *  final String apple = new Reduced<>(
- *          (first, last) -> first,
- *          new IterableOf<Scalar<String>>(
- *              () -> "Apple",
- *              () -> "Banana",
- *              () -> "Orange"
- *          )
- *      ).value();
- *  final String orange = new Reduced<>(
- *          (first, last) -> last,
- *          new IterableOf<Scalar<String>>(
- *              () -> "Apple",
- *              () -> "Banana",
- *              () -> "Orange"
- *          )
- *      ).value();
- * 
+ *
{@code
+ * final String apple = new Reduced<>(
+ *     (first, last) -> first,
+ *     new IterableOf>(
+ *         () -> "Apple",
+ *         () -> "Banana",
+ *         () -> "Orange"
+ *     )
+ * ).value();
+ * final String orange = new Reduced<>(
+ *     (first, last) -> last,
+ *     new IterableOf>(
+ *         () -> "Apple",
+ *         () -> "Banana",
+ *         () -> "Orange"
+ *     )
+ * ).value();
+ * }
* *

There is no thread-safety guarantee. * diff --git a/src/main/java/org/cactoos/scalar/RetryScalar.java b/src/main/java/org/cactoos/scalar/RetryScalar.java index 72430b69bd..d04b8ba68c 100644 --- a/src/main/java/org/cactoos/scalar/RetryScalar.java +++ b/src/main/java/org/cactoos/scalar/RetryScalar.java @@ -30,17 +30,17 @@ /** * Func that will try a few times before throwing an exception. * - *

+ * 
{@code
  * new RetryScalar<>(
  *     () -> {
  *         if (new SecureRandom().nextDouble() > 0.3d) {
- *         throw new IllegalArgumentException("May happen");
- *       }
- *       return 0;
+ *             throw new IllegalArgumentException("May happen");
+ *         }
+ *         return 0;
  *     },
  *     5
  * ).value() // will try to run 5 times before throwing an exception
- * 
+ * }
* *

There is no thread-safety guarantee. * diff --git a/src/main/java/org/cactoos/scalar/StickyScalar.java b/src/main/java/org/cactoos/scalar/StickyScalar.java index 3bdbe6f191..e8be30131b 100644 --- a/src/main/java/org/cactoos/scalar/StickyScalar.java +++ b/src/main/java/org/cactoos/scalar/StickyScalar.java @@ -41,14 +41,14 @@ * it more convenient and get rid of the checked exception you can * use {@link UncheckedScalar} or {@link IoCheckedScalar} decorators.

* - *
- * final Scalar<Integer> scalar = new StickyScalar<>(
+ * 
{@code
+ * final Scalar scalar = new StickyScalar<>(
  *     () -> {
  *         System.out.println("Will be printed only once");
  *         return new SecureRandom().nextInt();
  *     }
  * ).value()
- * 
+ * }
* *

There is no thread-safety guarantee. * diff --git a/src/main/java/org/cactoos/scalar/SumOfDoubleScalar.java b/src/main/java/org/cactoos/scalar/SumOfDoubleScalar.java index 1cd1ed860b..60a2b4c0e9 100644 --- a/src/main/java/org/cactoos/scalar/SumOfDoubleScalar.java +++ b/src/main/java/org/cactoos/scalar/SumOfDoubleScalar.java @@ -30,9 +30,9 @@ * *

Here is how you can use it to summarize double numbers:

* - *
+ * 
{@code
  * double sum = new SumOfDoubleScalar(() -> 1.1,() -> 2.1, () -> 3.1).value();
- * 
+ * }
* *

This class implements {@link Scalar}, which throws a checked * {@link Exception}. This may not be convenient in many cases. To make diff --git a/src/main/java/org/cactoos/scalar/SumOfFloatScalar.java b/src/main/java/org/cactoos/scalar/SumOfFloatScalar.java index 83819d4851..32314e3f91 100644 --- a/src/main/java/org/cactoos/scalar/SumOfFloatScalar.java +++ b/src/main/java/org/cactoos/scalar/SumOfFloatScalar.java @@ -30,9 +30,9 @@ * *

Here is how you can use it to summarize float numbers:

* - *
+ * 
{@code
  * float sum = new SumOfFloatScalar(() -> 1f,() -> 2f, () -> 3f).value();
- * 
+ * }
* *

This class implements {@link Scalar}, which throws a checked * {@link Exception}. This may not be convenient in many cases. To make diff --git a/src/main/java/org/cactoos/scalar/SumOfIntScalar.java b/src/main/java/org/cactoos/scalar/SumOfIntScalar.java index 8ac91a19a7..a4a78eff24 100644 --- a/src/main/java/org/cactoos/scalar/SumOfIntScalar.java +++ b/src/main/java/org/cactoos/scalar/SumOfIntScalar.java @@ -30,9 +30,10 @@ * *

Here is how you can use it to summarize numbers:

* - *
- * int sum = new SumOfIntScalar(() -> 1,() -> 2, () -> 3).value(); //equal to 6
- * 
+ *
{@code
+ * int sum = new SumOfIntScalar(() -> 1,() -> 2, () -> 3).value();
+ * // sum equal to 6
+ * }
* *

This class implements {@link Scalar}, which throws a checked * {@link Exception}. This may not be convenient in many cases. To make diff --git a/src/main/java/org/cactoos/scalar/SumOfLongScalar.java b/src/main/java/org/cactoos/scalar/SumOfLongScalar.java index 47ef7edd7c..a4bda632e8 100644 --- a/src/main/java/org/cactoos/scalar/SumOfLongScalar.java +++ b/src/main/java/org/cactoos/scalar/SumOfLongScalar.java @@ -30,9 +30,9 @@ * *

Here is how you can use it to summarize numbers:

* - *
+ * 
{@code
  * long sum = new SumOfLongScalar(() -> 1,() -> 2, () -> 3).value();
- * 
+ * }
* *

This class implements {@link Scalar}, which throws a checked * {@link Exception}. This may not be convenient in many cases. To make diff --git a/src/main/java/org/cactoos/scalar/SyncScalar.java b/src/main/java/org/cactoos/scalar/SyncScalar.java index c473ece1df..157d5a8ac5 100644 --- a/src/main/java/org/cactoos/scalar/SyncScalar.java +++ b/src/main/java/org/cactoos/scalar/SyncScalar.java @@ -33,13 +33,13 @@ * it more convenient and get rid of the checked exception you can * use {@link UncheckedScalar} or {@link IoCheckedScalar} decorators.

* - *
- * final List<Integer> list = new LinkedList<>();
+ * 
{@code
+ * final List list = new LinkedList<>();
  * final int threads = 100;
  * new RunsInThreads<>(
  *     new SyncScalar<>(() -> list.add(1)), threads
  * ); // list.size() will be equal to threads value
- * 
+ * }
* *

Objects of this class are thread-safe.

* diff --git a/src/main/java/org/cactoos/scalar/Ternary.java b/src/main/java/org/cactoos/scalar/Ternary.java index e3d39e0e51..9bc6ea1870 100644 --- a/src/main/java/org/cactoos/scalar/Ternary.java +++ b/src/main/java/org/cactoos/scalar/Ternary.java @@ -36,14 +36,14 @@ * it more convenient and get rid of the checked exception you can * use {@link UncheckedScalar} or {@link IoCheckedScalar} decorators.

* - *
+ * 
{@code
  * new Ternary<>(
  *     5,
  *     input -> input > 3,
  *     input -> input = 8,
  *     input -> input = 2
  * ).value() // will be equal to 8
- * 
+ * }
* * @param Type of item. * @since 0.8 diff --git a/src/main/java/org/cactoos/text/ComparableText.java b/src/main/java/org/cactoos/text/ComparableText.java index 68a88a9d4b..b337f4bcc2 100644 --- a/src/main/java/org/cactoos/text/ComparableText.java +++ b/src/main/java/org/cactoos/text/ComparableText.java @@ -29,14 +29,14 @@ /** * Text implementing Comparable.
* Below the example how you can sort words in a string: - *
- * Iterable<Text> sorted = new Sorted<>(
- *   new Mapped<>(
- *     ComparableText::new,
- *     new SplitText("The quick brown fox jumps over the lazy dog", " ")
- *   )
+ * 
{@code
+ * Iterable sorted = new Sorted<>(
+ *     new Mapped<>(
+ *         ComparableText::new,
+ *         new SplitText("The quick brown fox jumps over the lazy dog", " ")
+ *     )
  * )
- * 
+ * }
* *

There is no thread-safety guarantee. * diff --git a/src/main/java/org/cactoos/text/ReplacedText.java b/src/main/java/org/cactoos/text/ReplacedText.java index 57b41e19d9..2aed02ec82 100644 --- a/src/main/java/org/cactoos/text/ReplacedText.java +++ b/src/main/java/org/cactoos/text/ReplacedText.java @@ -80,15 +80,13 @@ public ReplacedText( * {@link Matcher#find() matching} substring. *

* Example usage: - *

-     * {@code
-     *     final String result = new ReplacedText(
-     *          new TextOf("one two THREE four FIVE six"),
-     *          () -> Pattern.compile("[a-z]+"),
-     *          matcher -> String.valueOf(matcher.group().length())
-     *     ).asString();  //will return the string "3 3 THREE 4 FIVE 3"
-     * }
-     * 
+ *
{@code
+     * final String result = new ReplacedText(
+     *      new TextOf("one two THREE four FIVE six"),
+     *      () -> Pattern.compile("[a-z]+"),
+     *      matcher -> String.valueOf(matcher.group().length())
+     * ).asString();  //will return the string "3 3 THREE 4 FIVE 3"
+     * }
*

* Note: a {@link PatternSyntaxException} will be thrown if the * regular expression's syntax is invalid.