diff --git a/src/main/java/org/apache/commons/lang3/AnnotationUtils.java b/src/main/java/org/apache/commons/lang3/AnnotationUtils.java index 2a995e3fc1f..bc480081945 100644 --- a/src/main/java/org/apache/commons/lang3/AnnotationUtils.java +++ b/src/main/java/org/apache/commons/lang3/AnnotationUtils.java @@ -49,7 +49,7 @@ public class AnnotationUtils { */ private static final ToStringStyle TO_STRING_STYLE = new ToStringStyle() { - /** Serialization version */ + /** Serialization version. */ private static final long serialVersionUID = 1L; { @@ -232,10 +232,10 @@ && isValidAnnotationMemberType(m.getReturnType())) { * @param a the Annotation for a hash code calculation is desired, not * {@code null} * @return the calculated hash code - * @throws RuntimeException if an {@link Exception} is encountered during - * annotation member access * @throws IllegalStateException if an annotation method invocation returns * {@code null} + * @throws RuntimeException if an {@link Exception} is encountered during + * annotation member access */ public static int hashCode(final Annotation a) { int result = 0; diff --git a/src/main/java/org/apache/commons/lang3/AppendableJoiner.java b/src/main/java/org/apache/commons/lang3/AppendableJoiner.java index eb19fac2455..bbf9add3bee 100644 --- a/src/main/java/org/apache/commons/lang3/AppendableJoiner.java +++ b/src/main/java/org/apache/commons/lang3/AppendableJoiner.java @@ -73,7 +73,7 @@ * This class is immutable and thread-safe. *

* - * @param the type of elements to join. + * @param the type of elements to join * @see Appendable * @see StringBuilder * @see String#join(CharSequence, CharSequence...) @@ -86,7 +86,7 @@ public final class AppendableJoiner { /** * Builds instances of {@link AppendableJoiner}. * - * @param the type of elements to join. + * @param the type of elements to join */ public static final class Builder implements Supplier> { @@ -99,7 +99,9 @@ public static final class Builder implements Supplier> { /** The delimiter that separates each element. */ private CharSequence delimiter; - /** The consumer used to render each element of type {@code T} onto an {@link Appendable}. */ + /** + * The consumer used to render each element of type {@code T} onto an {@link Appendable}. + */ private FailableBiConsumer appender; /** @@ -120,8 +122,8 @@ public AppendableJoiner get() { /** * Sets the delimiter that separates each element. * - * @param delimiter The delimiter that separates each element. - * @return {@code this} instance. + * @param delimiter the delimiter that separates each element + * @return {@code this} instance */ public Builder setDelimiter(final CharSequence delimiter) { this.delimiter = delimiter; @@ -131,8 +133,8 @@ public Builder setDelimiter(final CharSequence delimiter) { /** * Sets the consumer used to render each element of type {@code T} onto an {@link Appendable}. * - * @param appender The consumer used to render each element of type {@code T} onto an {@link Appendable}. - * @return {@code this} instance. + * @param appender the consumer used to render each element of type {@code T} onto an {@link Appendable} + * @return {@code this} instance */ public Builder setElementAppender(final FailableBiConsumer appender) { this.appender = appender; @@ -142,8 +144,8 @@ public Builder setElementAppender(final FailableBiConsumer setPrefix(final CharSequence prefix) { this.prefix = prefix; @@ -153,8 +155,8 @@ public Builder setPrefix(final CharSequence prefix) { /** * Sets the sequence of characters to be used at the end. * - * @param suffix The sequence of characters to be used at the end. - * @return {@code this} instance. + * @param suffix the sequence of characters to be used at the end + * @return {@code this} instance */ public Builder setSuffix(final CharSequence suffix) { this.suffix = suffix; @@ -166,8 +168,8 @@ public Builder setSuffix(final CharSequence suffix) { /** * Creates a new builder. * - * @param The type of elements. - * @return a new builder. + * @param the type of elements + * @return a new builder */ public static Builder builder() { return new Builder<>(); @@ -265,9 +267,9 @@ private AppendableJoiner(final CharSequence prefix, final CharSequence suffix, f /** * Joins stringified objects from the given Iterable into a StringBuilder. * - * @param stringBuilder The target. - * @param elements The source. - * @return The given StringBuilder. + * @param stringBuilder the target + * @param elements the source + * @return the given StringBuilder */ public StringBuilder join(final StringBuilder stringBuilder, final Iterable elements) { return joinI(stringBuilder, prefix, suffix, delimiter, appender, elements); @@ -276,9 +278,9 @@ public StringBuilder join(final StringBuilder stringBuilder, final Iterable e /** * Joins stringified objects from the given array into a StringBuilder. * - * @param stringBuilder The target. - * @param elements The source. - * @return the given target StringBuilder. + * @param stringBuilder the target + * @param elements the source + * @return the given target StringBuilder */ public StringBuilder join(final StringBuilder stringBuilder, @SuppressWarnings("unchecked") final T... elements) { return joinSB(stringBuilder, prefix, suffix, delimiter, appender, elements); @@ -287,11 +289,11 @@ public StringBuilder join(final StringBuilder stringBuilder, @SuppressWarnings(" /** * Joins stringified objects from the given Iterable into an Appendable. * - * @param the Appendable type. - * @param appendable The target. - * @param elements The source. - * @return The given StringBuilder. - * @throws IOException If an I/O error occurs + * @param the Appendable type + * @param appendable the target + * @param elements the source + * @return the given StringBuilder + * @throws IOException if an I/O error occurs */ public A joinA(final A appendable, final Iterable elements) throws IOException { return joinIterable(appendable, prefix, suffix, delimiter, appender, elements); @@ -300,11 +302,11 @@ public A joinA(final A appendable, final Iterable elem /** * Joins stringified objects from the given array into an Appendable. * - * @param the Appendable type. - * @param appendable The target. - * @param elements The source. - * @return The given StringBuilder. - * @throws IOException If an I/O error occurs + * @param the Appendable type + * @param appendable the target + * @param elements the source + * @return the given StringBuilder + * @throws IOException if an I/O error occurs */ public A joinA(final A appendable, @SuppressWarnings("unchecked") final T... elements) throws IOException { return joinA(appendable, prefix, suffix, delimiter, appender, elements); diff --git a/src/main/java/org/apache/commons/lang3/ArchUtils.java b/src/main/java/org/apache/commons/lang3/ArchUtils.java index 38fff6b8439..b4663f5d239 100644 --- a/src/main/java/org/apache/commons/lang3/ArchUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArchUtils.java @@ -42,9 +42,9 @@ public class ArchUtils { /** * Adds the given {@link Processor} with the given key {@link String} to the map. * - * @param key The key as {@link String}. - * @param processor The {@link Processor} to add. - * @throws IllegalStateException If the key already exists. + * @param key the key as {@link String} + * @param processor the {@link Processor} to add + * @throws IllegalStateException if the key already exists */ private static void addProcessor(final String key, final Processor processor) { if (ARCH_TO_PROCESSOR.containsKey(key)) { @@ -56,9 +56,9 @@ private static void addProcessor(final String key, final Processor processor) { /** * Adds the given {@link Processor} with the given keys to the map. * - * @param keys The keys. - * @param processor The {@link Processor} to add. - * @throws IllegalStateException If the key already exists. + * @param keys the keys + * @param processor the {@link Processor} to add + * @throws IllegalStateException if the key already exists */ private static void addProcessors(final Processor processor, final String... keys) { Streams.of(keys).forEach(e -> addProcessor(e, processor)); @@ -71,7 +71,7 @@ private static void addProcessors(final Processor processor, final String... key * Important: The {@code "os.arch"} system property returns the architecture used by the JVM not of the operating system. *

* - * @return A {@link Processor} when supported, else {@code null}. + * @return a {@link Processor} when supported, else {@code null} */ public static Processor getProcessor() { return getProcessor(SystemProperties.getOsArch()); @@ -81,8 +81,8 @@ public static Processor getProcessor() { * Gets a {@link Processor} object the given value {@link String}. The {@link String} must be like a value returned by the {@code "os.arch"} system * property. * - * @param value A {@link String} like a value returned by the {@code os.arch} System Property. - * @return A {@link Processor} when it exists, else {@code null}. + * @param value a {@link String} like a value returned by the {@code os.arch} System Property + * @return a {@link Processor} when it exists, else {@code null} */ public static Processor getProcessor(final String value) { return ARCH_TO_PROCESSOR.get(value); diff --git a/src/main/java/org/apache/commons/lang3/ArrayFill.java b/src/main/java/org/apache/commons/lang3/ArrayFill.java index d0dc1441852..474ae111a10 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayFill.java +++ b/src/main/java/org/apache/commons/lang3/ArrayFill.java @@ -32,9 +32,9 @@ public final class ArrayFill { /** * Fills and returns the given array, assigning the given {@code boolean} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(boolean[],boolean) * @since 3.18.0 */ @@ -48,9 +48,9 @@ public static boolean[] fill(final boolean[] a, final boolean val) { /** * Fills and returns the given array, assigning the given {@code byte} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(byte[],byte) */ public static byte[] fill(final byte[] a, final byte val) { @@ -63,9 +63,9 @@ public static byte[] fill(final byte[] a, final byte val) { /** * Fills and returns the given array, assigning the given {@code char} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(char[],char) */ public static char[] fill(final char[] a, final char val) { @@ -78,9 +78,9 @@ public static char[] fill(final char[] a, final char val) { /** * Fills and returns the given array, assigning the given {@code double} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(double[],double) */ public static double[] fill(final double[] a, final double val) { @@ -93,9 +93,9 @@ public static double[] fill(final double[] a, final double val) { /** * Fills and returns the given array, assigning the given {@code float} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(float[],float) */ public static float[] fill(final float[] a, final float val) { @@ -108,9 +108,9 @@ public static float[] fill(final float[] a, final float val) { /** * Fills and returns the given array, assigning the given {@code int} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(int[],int) */ public static int[] fill(final int[] a, final int val) { @@ -123,9 +123,9 @@ public static int[] fill(final int[] a, final int val) { /** * Fills and returns the given array, assigning the given {@code long} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(long[],long) */ public static long[] fill(final long[] a, final long val) { @@ -138,9 +138,9 @@ public static long[] fill(final long[] a, final long val) { /** * Fills and returns the given array, assigning the given {@code short} value to each element of the array. * - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(short[],short) */ public static short[] fill(final short[] a, final short val) { @@ -158,12 +158,12 @@ public static short[] fill(final short[] a, final short val) { * state. *

* - * @param type of elements of the array. - * @param array array to be initialized. - * @param generator a function accepting an index and producing the desired value for that position. + * @param type of elements of the array + * @param array array to be initialized + * @param generator a function accepting an index and producing the desired value for that position + * @param the kind of thrown exception or error * @return the input array - * @param The kind of thrown exception or error. - * @throws E Thrown by the given {@code generator}. + * @throws E thrown by the given {@code generator} * @see Arrays#setAll(Object[], IntFunction) * @since 3.18.0 */ @@ -179,10 +179,10 @@ public static T[] fill(final T[] array, final FailableI /** * Fills and returns the given array, assigning the given {@code T} value to each element of the array. * - * @param the array type. - * @param a the array to be filled (may be null). - * @param val the value to be stored in all elements of the array. - * @return the given array. + * @param the array type + * @param a the array to be filled (may be null) + * @param val the value to be stored in all elements of the array + * @return the given array * @see Arrays#fill(Object[],Object) */ public static T[] fill(final T[] a, final T val) { diff --git a/src/main/java/org/apache/commons/lang3/ArraySorter.java b/src/main/java/org/apache/commons/lang3/ArraySorter.java index 17ecc0610d6..ea2a1364d71 100644 --- a/src/main/java/org/apache/commons/lang3/ArraySorter.java +++ b/src/main/java/org/apache/commons/lang3/ArraySorter.java @@ -31,8 +31,8 @@ public class ArraySorter { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(byte[]) */ public static byte[] sort(final byte[] array) { @@ -45,8 +45,8 @@ public static byte[] sort(final byte[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(char[]) */ public static char[] sort(final char[] array) { @@ -59,8 +59,8 @@ public static char[] sort(final char[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(double[]) */ public static double[] sort(final double[] array) { @@ -73,8 +73,8 @@ public static double[] sort(final double[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(float[]) */ public static float[] sort(final float[] array) { @@ -87,8 +87,8 @@ public static float[] sort(final float[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(int[]) */ public static int[] sort(final int[] array) { @@ -101,8 +101,8 @@ public static int[] sort(final int[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(long[]) */ public static long[] sort(final long[] array) { @@ -115,8 +115,8 @@ public static long[] sort(final long[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param array the array to sort (may be null). - * @return the given array. + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(short[]) */ public static short[] sort(final short[] array) { @@ -129,9 +129,9 @@ public static short[] sort(final short[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param the array type. - * @param array the array to sort (may be null). - * @return the given array. + * @param the array type + * @param array the array to sort (may be null) + * @return the given array * @see Arrays#sort(Object[]) */ public static T[] sort(final T[] array) { @@ -144,11 +144,11 @@ public static T[] sort(final T[] array) { /** * Sorts the given array into ascending order and returns it. * - * @param the array type. - * @param array the array to sort (may be null). + * @param the array type + * @param array the array to sort (may be null) * @param comparator the comparator to determine the order of the array. A {@code null} value uses the elements' * {@link Comparable natural ordering}. - * @return the given array. + * @return the given array * @see Arrays#sort(Object[]) */ public static T[] sort(final T[] array, final Comparator comparator) { diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index 1faa21e5f40..e10d2633738 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -232,9 +232,9 @@ static int addExact(final int a, final int b) { * ArrayUtils.add([true, false], true) = [true, false, true] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static boolean[] add(final boolean[] array, final boolean element) { @@ -264,11 +264,11 @@ public static boolean[] add(final boolean[] array, final boolean element) { * ArrayUtils.add([true, false], 1, true) = [true, true, false] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index > array.length). + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, boolean[], boolean...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -295,9 +295,9 @@ public static boolean[] add(final boolean[] array, final int index, final boolea * ArrayUtils.add([1, 0], 1) = [1, 0, 1] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static byte[] add(final byte[] array, final byte element) { @@ -327,10 +327,10 @@ public static byte[] add(final byte[] array, final byte element) { * ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range. * (index < 0 || index > array.length). * @deprecated this method has been superseded by {@link #insert(int, byte[], byte...)} and @@ -359,9 +359,9 @@ public static byte[] add(final byte[] array, final int index, final byte element * ArrayUtils.add(['1', '0'], '1') = ['1', '0', '1'] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static char[] add(final char[] array, final char element) { @@ -392,10 +392,10 @@ public static char[] add(final char[] array, final char element) { * ArrayUtils.add(['a', 'b', 'c'], 1, 't') = ['a', 't', 'b', 'c'] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range. * (index < 0 || index > array.length). * @deprecated this method has been superseded by {@link #insert(int, char[], char...)} and @@ -425,9 +425,9 @@ public static char[] add(final char[] array, final int index, final char element * ArrayUtils.add([1, 0], 1) = [1, 0, 1] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static double[] add(final double[] array, final double element) { @@ -457,12 +457,12 @@ public static double[] add(final double[] array, final double element) { * ArrayUtils.add([2.9, 6.0, 0.3], 2, 1.0) = [2.9, 6.0, 1.0, 0.3] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index > array.length). + * (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, double[], double...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -489,9 +489,9 @@ public static double[] add(final double[] array, final int index, final double e * ArrayUtils.add([1, 0], 1) = [1, 0, 1] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static float[] add(final float[] array, final float element) { @@ -521,12 +521,12 @@ public static float[] add(final float[] array, final float element) { * ArrayUtils.add([2.9f, 6.0f, 0.3f], 2, 1.0f) = [2.9f, 6.0f, 1.0f, 0.3f] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index > array.length). + * (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, float[], float...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -553,9 +553,9 @@ public static float[] add(final float[] array, final int index, final float elem * ArrayUtils.add([1, 0], 1) = [1, 0, 1] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static int[] add(final int[] array, final int element) { @@ -585,12 +585,12 @@ public static int[] add(final int[] array, final int element) { * ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index > array.length). + * (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, int[], int...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -621,12 +621,12 @@ public static int[] add(final int[] array, final int index, final int element) { * ArrayUtils.add([2L, 6L, 3L], 2, 1L) = [2L, 6L, 1L, 3L] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index > array.length). + * (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, long[], long...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -653,9 +653,9 @@ public static long[] add(final long[] array, final int index, final long element * ArrayUtils.add([1, 0], 1) = [1, 0, 1] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static long[] add(final long[] array, final long element) { @@ -669,11 +669,11 @@ public static long[] add(final long[] array, final long element) { * The last parameter is the class, which may not equal element.getClass * for primitives. * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @param clazz the type of the element being added. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @param clazz the type of the element being added + * @return a new array containing the existing elements and the new element */ private static Object add(final Object array, final int index, final Object element, final Class clazz) { if (array == null) { @@ -717,12 +717,12 @@ private static Object add(final Object array, final int index, final Object elem * ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3] * * - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index > array.length). + * (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, short[], short...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -749,9 +749,9 @@ public static short[] add(final short[] array, final int index, final short elem * ArrayUtils.add([1, 0], 1) = [1, 0, 1] * * - * @param array the array to copy and add the element to, may be {@code null}. - * @param element the object to add at the last index of the new array. - * @return A new array containing the existing elements plus the new element. + * @param array the array to copy and add the element to, may be {@code null} + * @param element the object to add at the last index of the new array + * @return a new array containing the existing elements plus the new element * @since 2.1 */ public static short[] add(final short[] array, final short element) { @@ -782,13 +782,13 @@ public static short[] add(final short[] array, final short element) { * ArrayUtils.add(["a", "b"], 3, "c") = ["a", "b", "c"] * * - * @param the component type of the array. - * @param array the array to add the element to, may be {@code null}. - * @param index the position of the new object. - * @param element the object to add. - * @return A new array containing the existing elements and the new element. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index > array.length). - * @throws IllegalArgumentException if both array and element are null. + * @param the component type of the array + * @param array the array to add the element to, may be {@code null} + * @param index the position of the new object + * @param element the object to add + * @return a new array containing the existing elements and the new element + * @throws IllegalArgumentException if both array and element are null + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index > array.length) * @deprecated this method has been superseded by {@link #insert(int, Object[], Object...) insert(int, T[], T...)} and * may be removed in a future release. Please note the handling of {@code null} input arrays differs * in the new method: inserting {@code X} into a {@code null} array results in {@code null} not {@code X}. @@ -826,14 +826,14 @@ public static T[] add(final T[] array, final int index, final T element) { * ArrayUtils.add(["a", "b"], "c") = ["a", "b", "c"] * * - * @param the component type of the array. - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add, may be {@code null}. - * @return A new array containing the existing elements plus the new element + * @param the component type of the array + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add, may be {@code null} + * @return a new array containing the existing elements plus the new element * The returned array type will be that of the input array (unless null), * in which case it will have the same type as the element. * If both are null, an IllegalArgumentException is thrown. - * @throws IllegalArgumentException if both arguments are null. + * @throws IllegalArgumentException if both arguments are null * @since 2.1 */ public static T[] add(final T[] array, final T element) { @@ -866,9 +866,9 @@ public static T[] add(final T[] array, final T element) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new boolean[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new boolean[] array or {@code null} * @since 2.1 */ public static boolean[] addAll(final boolean[] array1, final boolean... array2) { @@ -898,9 +898,9 @@ public static boolean[] addAll(final boolean[] array1, final boolean... array2) * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new byte[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new byte[] array or {@code null} * @since 2.1 */ public static byte[] addAll(final byte[] array1, final byte... array2) { @@ -930,9 +930,9 @@ public static byte[] addAll(final byte[] array1, final byte... array2) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new char[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new char[] array or {@code null} * @since 2.1 */ public static char[] addAll(final char[] array1, final char... array2) { @@ -962,9 +962,9 @@ public static char[] addAll(final char[] array1, final char... array2) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new double[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new double[] array or {@code null} * @since 2.1 */ public static double[] addAll(final double[] array1, final double... array2) { @@ -994,9 +994,9 @@ public static double[] addAll(final double[] array1, final double... array2) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new float[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new float[] array or {@code null} * @since 2.1 */ public static float[] addAll(final float[] array1, final float... array2) { @@ -1026,9 +1026,9 @@ public static float[] addAll(final float[] array1, final float... array2) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new int[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new int[] array or {@code null} * @since 2.1 */ public static int[] addAll(final int[] array1, final int... array2) { @@ -1058,9 +1058,9 @@ public static int[] addAll(final int[] array1, final int... array2) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new long[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new long[] array or {@code null} * @since 2.1 */ public static long[] addAll(final long[] array1, final long... array2) { @@ -1090,9 +1090,9 @@ public static long[] addAll(final long[] array1, final long... array2) { * ArrayUtils.addAll(null, null) = null * * - * @param array1 the first array whose elements are added to the new array. - * @param array2 the second array whose elements are added to the new array. - * @return The new short[] array or {@code null}. + * @param array1 the first array whose elements are added to the new array + * @param array2 the second array whose elements are added to the new array + * @return the new short[] array or {@code null} * @since 2.1 */ public static short[] addAll(final short[] array1, final short... array2) { @@ -1125,13 +1125,13 @@ public static short[] addAll(final short[] array1, final short... array2) { * ArrayUtils.addAll(["a", "b", "c"], ["1", "2", "3"]) = ["a", "b", "c", "1", "2", "3"] * * - * @param the component type of the array. - * @param array1 the first array whose elements are added to the new array, may be {@code null}. - * @param array2 the second array whose elements are added to the new array, may be {@code null}. - * @return The new array, {@code null} if both arrays are {@code null}. + * @param the component type of the array + * @param array1 the first array whose elements are added to the new array, may be {@code null} + * @param array2 the second array whose elements are added to the new array, may be {@code null} + * @return the new array, {@code null} if both arrays are {@code null}. * The type of the new array is the type of the first array, * unless the first array is null, in which case the type is the same as the second array. - * @throws IllegalArgumentException if the array types are incompatible. + * @throws IllegalArgumentException if the array types are incompatible * @since 2.1 */ public static T[] addAll(final T[] array1, @SuppressWarnings("unchecked") final T... array2) { @@ -1167,7 +1167,7 @@ public static T[] addAll(final T[] array1, @SuppressWarnings("unchecked") fi * @param array the array whose length should be added (can be {@code null}, * in which case its length is considered 0) * @return the new total length after adding the array's length - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} */ private static int addExact(final int totalLength, final Object array) { try { @@ -1197,10 +1197,10 @@ private static int addExact(final int totalLength, final Object array) { * ArrayUtils.addFirst([true, false], true) = [true, true, false] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static boolean[] addFirst(final boolean[] array, final boolean element) { @@ -1223,10 +1223,10 @@ public static boolean[] addFirst(final boolean[] array, final boolean element) { * ArrayUtils.addFirst([1, 0], 1) = [1, 1, 0] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static byte[] addFirst(final byte[] array, final byte element) { @@ -1249,10 +1249,10 @@ public static byte[] addFirst(final byte[] array, final byte element) { * ArrayUtils.addFirst(['1', '0'], '1') = ['1', '1', '0'] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static char[] addFirst(final char[] array, final char element) { @@ -1275,10 +1275,10 @@ public static char[] addFirst(final char[] array, final char element) { * ArrayUtils.addFirst([1, 0], 1) = [1, 1, 0] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static double[] addFirst(final double[] array, final double element) { @@ -1301,10 +1301,10 @@ public static double[] addFirst(final double[] array, final double element) { * ArrayUtils.addFirst([1, 0], 1) = [1, 1, 0] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static float[] addFirst(final float[] array, final float element) { @@ -1327,10 +1327,10 @@ public static float[] addFirst(final float[] array, final float element) { * ArrayUtils.addFirst([1, 0], 1) = [1, 1, 0] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static int[] addFirst(final int[] array, final int element) { @@ -1353,10 +1353,10 @@ public static int[] addFirst(final int[] array, final int element) { * ArrayUtils.addFirst([1, 0], 1) = [1, 1, 0] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static long[] addFirst(final long[] array, final long element) { @@ -1379,10 +1379,10 @@ public static long[] addFirst(final long[] array, final long element) { * ArrayUtils.addFirst([1, 0], 1) = [1, 1, 0] * * - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add. - * @return A new array containing the existing elements plus the new element The returned array type will be that of - * the input array (unless null), in which case it will have the same type as the element. + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add + * @return a new array containing the existing elements plus the new element The returned array type will be that of + * the input array (unless null), in which case it will have the same type as the element * @since 3.10 */ public static short[] addFirst(final short[] array, final short element) { @@ -1407,13 +1407,13 @@ public static short[] addFirst(final short[] array, final short element) { * ArrayUtils.addFirst(["a", "b"], "c") = ["c", "a", "b"] * * - * @param the component type of the array. - * @param array the array to "add" the element to, may be {@code null}. - * @param element the object to add, may be {@code null}. - * @return A new array containing the existing elements plus the new element The returned array type will be that of + * @param the component type of the array + * @param array the array to "add" the element to, may be {@code null} + * @param element the object to add, may be {@code null} + * @return a new array containing the existing elements plus the new element The returned array type will be that of * the input array (unless null), in which case it will have the same type as the element. If both are null, * an IllegalArgumentException is thrown. - * @throws IllegalArgumentException if both arguments are null. + * @throws IllegalArgumentException if both arguments are null * @since 3.10 */ public static T[] addFirst(final T[] array, final T element) { @@ -1423,17 +1423,17 @@ public static T[] addFirst(final T[] array, final T element) { /** * A fluent version of {@link System#arraycopy(Object, int, Object, int, int)} that returns the destination array. * - * @param the type. - * @param source the source array. - * @param sourcePos starting position in the source array. - * @param destPos starting position in the destination data. - * @param length the number of array elements to be copied. - * @param allocator allocates the array to populate and return. + * @param the type + * @param source the source array + * @param sourcePos starting position in the source array + * @param destPos starting position in the destination data + * @param length the number of array elements to be copied + * @param allocator allocates the array to populate and return * @return dest - * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds. * @throws ArrayStoreException if an element in the {@code src} array could not be stored into the {@code dest} array because of a type - * mismatch. - * @throws NullPointerException if either {@code src} or {@code dest} is {@code null}. + * mismatch + * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds + * @throws NullPointerException if either {@code src} or {@code dest} is {@code null} * @since 3.15.0 */ public static T arraycopy(final T source, final int sourcePos, final int destPos, final int length, final Function allocator) { @@ -1443,17 +1443,17 @@ public static T arraycopy(final T source, final int sourcePos, final int des /** * A fluent version of {@link System#arraycopy(Object, int, Object, int, int)} that returns the destination array. * - * @param the type. - * @param source the source array. - * @param sourcePos starting position in the source array. - * @param destPos starting position in the destination data. - * @param length the number of array elements to be copied. - * @param allocator allocates the array to populate and return. + * @param the type + * @param source the source array + * @param sourcePos starting position in the source array + * @param destPos starting position in the destination data + * @param length the number of array elements to be copied + * @param allocator allocates the array to populate and return * @return dest - * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds. * @throws ArrayStoreException if an element in the {@code src} array could not be stored into the {@code dest} array because of a type - * mismatch. - * @throws NullPointerException if either {@code src} or {@code dest} is {@code null}. + * mismatch + * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds + * @throws NullPointerException if either {@code src} or {@code dest} is {@code null} * @since 3.15.0 */ public static T arraycopy(final T source, final int sourcePos, final int destPos, final int length, final Supplier allocator) { @@ -1463,17 +1463,17 @@ public static T arraycopy(final T source, final int sourcePos, final int des /** * A fluent version of {@link System#arraycopy(Object, int, Object, int, int)} that returns the destination array. * - * @param the type. - * @param source the source array. - * @param sourcePos starting position in the source array. - * @param dest the destination array. - * @param destPos starting position in the destination data. - * @param length the number of array elements to be copied. + * @param the type + * @param source the source array + * @param sourcePos starting position in the source array + * @param dest the destination array + * @param destPos starting position in the destination data + * @param length the number of array elements to be copied * @return dest - * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds. * @throws ArrayStoreException if an element in the {@code src} array could not be stored into the {@code dest} array because of a type - * mismatch. - * @throws NullPointerException if either {@code src} or {@code dest} is {@code null}. + * mismatch + * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds + * @throws NullPointerException if either {@code src} or {@code dest} is {@code null} * @since 3.15.0 */ public static T arraycopy(final T source, final int sourcePos, final T dest, final int destPos, final int length) { @@ -1487,8 +1487,8 @@ public static T arraycopy(final T source, final int sourcePos, final T dest, * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static boolean[] clone(final boolean[] array) { return array != null ? array.clone() : null; @@ -1500,8 +1500,8 @@ public static boolean[] clone(final boolean[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static byte[] clone(final byte[] array) { return array != null ? array.clone() : null; @@ -1513,8 +1513,8 @@ public static byte[] clone(final byte[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static char[] clone(final char[] array) { return array != null ? array.clone() : null; @@ -1526,8 +1526,8 @@ public static char[] clone(final char[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static double[] clone(final double[] array) { return array != null ? array.clone() : null; @@ -1539,8 +1539,8 @@ public static double[] clone(final double[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static float[] clone(final float[] array) { return array != null ? array.clone() : null; @@ -1552,8 +1552,8 @@ public static float[] clone(final float[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static int[] clone(final int[] array) { return array != null ? array.clone() : null; @@ -1565,8 +1565,8 @@ public static int[] clone(final int[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static long[] clone(final long[] array) { return array != null ? array.clone() : null; @@ -1578,8 +1578,8 @@ public static long[] clone(final long[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param array the array to clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param array the array to clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static short[] clone(final short[] array) { return array != null ? array.clone() : null; @@ -1594,9 +1594,9 @@ public static short[] clone(final short[] array) { * This method returns {@code null} for a {@code null} input array. *

* - * @param the component type of the array. - * @param array the array to shallow clone, may be {@code null}. - * @return the cloned array, {@code null} if {@code null} input. + * @param the component type of the array + * @param array the array to shallow clone, may be {@code null} + * @return the cloned array, {@code null} if {@code null} input */ public static T[] clone(final T[] array) { return array != null ? array.clone() : null; @@ -1613,9 +1613,9 @@ public static T[] clone(final T[] array) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new boolean array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static boolean[] concat(boolean[]... arrays) { @@ -1645,9 +1645,9 @@ public static boolean[] concat(boolean[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new byte array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static byte[] concat(byte[]... arrays) { @@ -1677,9 +1677,9 @@ public static byte[] concat(byte[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new char array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static char[] concat(char[]... arrays) { @@ -1709,9 +1709,9 @@ public static char[] concat(char[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new double array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static double[] concat(double[]... arrays) { @@ -1741,9 +1741,9 @@ public static double[] concat(double[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new float array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static float[] concat(float[]... arrays) { @@ -1773,9 +1773,9 @@ public static float[] concat(float[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new int array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static int[] concat(int[]... arrays) { @@ -1805,9 +1805,9 @@ public static int[] concat(int[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new long array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static long[] concat(long[]... arrays) { @@ -1837,9 +1837,9 @@ public static long[] concat(long[]... arrays) { * @param arrays the arrays to concatenate. Can be empty, contain nulls, * or be null itself (treated as empty varargs). * @return a new short array containing all elements from the input arrays - * in the order they appear, or an empty array if no elements are present. - * @throws NullPointerException if the input array of arrays is null. - * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}. + * in the order they appear, or an empty array if no elements are present + * @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH} + * @throws NullPointerException if the input array of arrays is null * @since 3.21.0 */ public static short[] concat(short[]... arrays) { @@ -1864,9 +1864,9 @@ public static short[] concat(short[]... arrays) { * The method returns {@code false} if a {@code null} array is passed in. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final boolean[] array, final boolean valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -1882,9 +1882,9 @@ public static boolean contains(final boolean[] array, final boolean valueToFind) * {@link Arrays#sort(byte[])} and {@link Arrays#binarySearch(byte[], byte)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final byte[] array, final byte valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -1900,9 +1900,9 @@ public static boolean contains(final byte[] array, final byte valueToFind) { * {@link Arrays#sort(char[])} and {@link Arrays#binarySearch(char[], char)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object * @since 2.1 */ public static boolean contains(final char[] array, final char valueToFind) { @@ -1919,9 +1919,9 @@ public static boolean contains(final char[] array, final char valueToFind) { * {@link Arrays#sort(double[])} and {@link Arrays#binarySearch(double[], double)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final double[] array, final double valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -1940,10 +1940,10 @@ public static boolean contains(final double[] array, final double valueToFind) { * {@link Arrays#sort(double[])} and {@link Arrays#binarySearch(double[], double)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @param tolerance the array contains the tolerance of the search. - * @return true if value falling within tolerance is in array. + * @param array the array to search + * @param valueToFind the value to find + * @param tolerance the array contains the tolerance of the search + * @return true if value falling within tolerance is in array */ public static boolean contains(final double[] array, final double valueToFind, final double tolerance) { return indexOf(array, valueToFind, 0, tolerance) != INDEX_NOT_FOUND; @@ -1959,9 +1959,9 @@ public static boolean contains(final double[] array, final double valueToFind, f * {@link Arrays#sort(float[])} and {@link Arrays#binarySearch(float[], float)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final float[] array, final float valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -1977,9 +1977,9 @@ public static boolean contains(final float[] array, final float valueToFind) { * {@link Arrays#sort(int[])} and {@link Arrays#binarySearch(int[], int)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final int[] array, final int valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -1995,9 +1995,9 @@ public static boolean contains(final int[] array, final int valueToFind) { * {@link Arrays#sort(long[])} and {@link Arrays#binarySearch(long[], long)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final long[] array, final long valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -2013,9 +2013,9 @@ public static boolean contains(final long[] array, final long valueToFind) { * {@link Arrays#sort(Object[], Comparator)} and {@link Arrays#binarySearch(Object[], Object)}. *

* - * @param array the array to search, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. - * @return {@code true} if the array contains the object. + * @param array the array to search, may be {@code null} + * @param objectToFind the object to find, may be {@code null} + * @return {@code true} if the array contains the object */ public static boolean contains(final Object[] array, final Object objectToFind) { return indexOf(array, objectToFind) != INDEX_NOT_FOUND; @@ -2031,9 +2031,9 @@ public static boolean contains(final Object[] array, final Object objectToFind) * {@link Arrays#sort(short[])} and {@link Arrays#binarySearch(short[], short)}. *

* - * @param array the array to search. - * @param valueToFind the value to find. - * @return {@code true} if the array contains the object. + * @param array the array to search + * @param valueToFind the value to find + * @return {@code true} if the array contains the object */ public static boolean contains(final short[] array, final short valueToFind) { return indexOf(array, valueToFind) != INDEX_NOT_FOUND; @@ -2049,9 +2049,9 @@ public static boolean contains(final short[] array, final short valueToFind) { * {@link Arrays#sort(int[])} and {@link Arrays#binarySearch(int[], int)}. *

* - * @param array the array to search. - * @param objectsToFind any of the ints to find. - * @return {@code true} if the array contains any of the ints. + * @param array the array to search + * @param objectsToFind any of the ints to find + * @return {@code true} if the array contains any of the ints * @since 3.18.0 */ public static boolean containsAny(final int[] array, final int... objectsToFind) { @@ -2068,9 +2068,9 @@ public static boolean containsAny(final int[] array, final int... objectsToFind) * {@link Arrays#sort(Object[], Comparator)} and {@link Arrays#binarySearch(Object[], Object)}. *

* - * @param array the array to search, may be {@code null}. - * @param objectsToFind any of the objects to find, may be {@code null}. - * @return {@code true} if the array contains any of the objects. + * @param array the array to search, may be {@code null} + * @param objectsToFind any of the objects to find, may be {@code null} + * @return {@code true} if the array contains any of the objects * @since 3.13.0 */ public static boolean containsAny(final Object[] array, final Object... objectsToFind) { @@ -2081,10 +2081,10 @@ public static boolean containsAny(final Object[] array, final Object... objectsT * Returns a copy of the given array of size 1 greater than the argument. * The last value of the array is left to the default value. * - * @param array The array to copy, must not be {@code null}. - * @param newArrayComponentType If {@code array} is {@code null}, create a - * size 1 array of this type. - * @return A new copy of the array of size 1 greater than the input. + * @param array the array to copy, must not be {@code null} + * @param newArrayComponentType if {@code array} is {@code null}, create a + * size 1 array of this type + * @return a new copy of the array of size 1 greater than the input */ private static Object copyArrayGrow1(final Object array, final Class newArrayComponentType) { if (array != null) { @@ -2099,10 +2099,10 @@ private static Object copyArrayGrow1(final Object array, final Class newArray /** * Gets the nTh element of an array or null if the index is out of bounds or the array is null. * - * @param The type of array elements. - * @param array The array to index. - * @param index The index. - * @return the nTh element of an array or null if the index is out of bounds or the array is null. + * @param the type of array elements + * @param array the array to index + * @param index the index + * @return the nTh element of an array or null if the index is out of bounds or the array is null * @since 3.11 */ public static T get(final T[] array, final int index) { @@ -2112,11 +2112,11 @@ public static T get(final T[] array, final int index) { /** * Gets the nTh element of an array or a default value if the index is out of bounds. * - * @param The type of array elements. - * @param array The array to index. - * @param index The index. - * @param defaultValue The return value of the given index is out of bounds. - * @return the nTh element of an array or a default value if the index is out of bounds. + * @param the type of array elements + * @param array the array to index + * @param index the index + * @param defaultValue the return value of the given index is out of bounds + * @return the nTh element of an array or a default value if the index is out of bounds * @since 3.11 */ public static T get(final T[] array, final int index, final T defaultValue) { @@ -2126,9 +2126,9 @@ public static T get(final T[] array, final int index, final T defaultValue) /** * Gets an array's component type. * - * @param The array type. - * @param array The array. - * @return The component type. + * @param the array type + * @param array the array + * @return the component type * @since 3.13.0 */ public static Class getComponentType(final T[] array) { @@ -2141,10 +2141,10 @@ public static Class getComponentType(final T[] array) { * The
JVM specification limits the number of dimensions to 255. *

* - * @param array the array, may be {@code null}. - * @return The number of dimensions, 0 if the input is null or not an array. The JVM specification limits the number of dimensions to 255. - * @since 3.21.0 + * @param array the array, may be {@code null} + * @return the number of dimensions, 0 if the input is null or not an array. The JVM specification limits the number of dimensions to 255. * @see JVM specification Field Descriptors + * @since 3.21.0 */ public static int getDimensions(final Object array) { int dimensions = 0; @@ -2173,9 +2173,9 @@ public static int getDimensions(final Object array) { * ArrayUtils.getLength(["a", "b", "c"]) = 3 * * - * @param array the array to retrieve the length from, may be {@code null}. - * @return The length of the array, or {@code 0} if the array is {@code null}. - * @throws IllegalArgumentException if the object argument is not an array. + * @param array the array to retrieve the length from, may be {@code null} + * @return the length of the array, or {@code 0} if the array is {@code null} + * @throws IllegalArgumentException if the object argument is not an array * @since 2.1 */ public static int getLength(final Object array) { @@ -2188,8 +2188,8 @@ public static int getLength(final Object array) { * Multi-dimensional primitive arrays are also handled correctly by this method. *

* - * @param array the array to get a hash code for, {@code null} returns zero. - * @return a hash code for the array. + * @param array the array to get a hash code for, {@code null} returns zero + * @return a hash code for the array */ public static int hashCode(final Object array) { return new HashCodeBuilder().append(array).toHashCode(); @@ -2205,10 +2205,10 @@ static void increment(final Map occurrences, final K boxed) { * This method returns an empty BitSet for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final boolean[] array, final boolean valueToFind) { @@ -2224,10 +2224,10 @@ public static BitSet indexesOf(final boolean[] array, final boolean valueToFind) * A negative startIndex is treated as zero. A startIndex larger than the array length will return an empty BitSet ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return a BitSet of all the indices of the value within the array, an empty BitSet if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return a BitSet of all the indices of the value within the array, an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final boolean[] array, final boolean valueToFind, int startIndex) { @@ -2252,9 +2252,9 @@ public static BitSet indexesOf(final boolean[] array, final boolean valueToFind, * This method returns an empty BitSet for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return a BitSet of all the indices of the value within the array, an empty BitSet if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return a BitSet of all the indices of the value within the array, an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final byte[] array, final byte valueToFind) { @@ -2269,11 +2269,11 @@ public static BitSet indexesOf(final byte[] array, final byte valueToFind) { *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final byte[] array, final byte valueToFind, int startIndex) { @@ -2296,10 +2296,10 @@ public static BitSet indexesOf(final byte[] array, final byte valueToFind, int s * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final char[] array, final char valueToFind) { @@ -2314,11 +2314,11 @@ public static BitSet indexesOf(final char[] array, final char valueToFind) { *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final char[] array, final char valueToFind, int startIndex) { @@ -2341,10 +2341,10 @@ public static BitSet indexesOf(final char[] array, final char valueToFind, int s * *

This method returns empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final double[] array, final double valueToFind) { @@ -2361,11 +2361,11 @@ public static BitSet indexesOf(final double[] array, final double valueToFind) { * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param tolerance tolerance of the search. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param tolerance tolerance of the search * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final double[] array, final double valueToFind, final double tolerance) { @@ -2380,11 +2380,11 @@ public static BitSet indexesOf(final double[] array, final double valueToFind, f *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final double[] array, final double valueToFind, int startIndex) { @@ -2415,12 +2415,12 @@ public static BitSet indexesOf(final double[] array, final double valueToFind, i *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @param tolerance tolerance of the search. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @param tolerance tolerance of the search * @return a BitSet of the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final double[] array, final double valueToFind, int startIndex, final double tolerance) { @@ -2443,10 +2443,10 @@ public static BitSet indexesOf(final double[] array, final double valueToFind, i * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final float[] array, final float valueToFind) { @@ -2461,11 +2461,11 @@ public static BitSet indexesOf(final float[] array, final float valueToFind) { *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final float[] array, final float valueToFind, int startIndex) { @@ -2488,10 +2488,10 @@ public static BitSet indexesOf(final float[] array, final float valueToFind, int * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final int[] array, final int valueToFind) { @@ -2506,11 +2506,11 @@ public static BitSet indexesOf(final int[] array, final int valueToFind) { *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final int[] array, final int valueToFind, int startIndex) { @@ -2533,10 +2533,10 @@ public static BitSet indexesOf(final int[] array, final int valueToFind, int sta * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final long[] array, final long valueToFind) { @@ -2551,11 +2551,11 @@ public static BitSet indexesOf(final long[] array, final long valueToFind) { *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final long[] array, final long valueToFind, int startIndex) { @@ -2578,10 +2578,10 @@ public static BitSet indexesOf(final long[] array, final long valueToFind, int s * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. + * @param array the array to search for the object, may be {@code null} + * @param objectToFind the object to find, may be {@code null} * @return a BitSet of all the indices of the object within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final Object[] array, final Object objectToFind) { @@ -2596,11 +2596,11 @@ public static BitSet indexesOf(final Object[] array, final Object objectToFind) *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param objectToFind the object to find, may be {@code null} + * @param startIndex the index to start searching * @return a BitSet of all the indices of the object within the array starting at the index, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final Object[] array, final Object objectToFind, int startIndex) { @@ -2623,10 +2623,10 @@ public static BitSet indexesOf(final Object[] array, final Object objectToFind, * *

This method returns an empty BitSet for a {@code null} input array.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final short[] array, final short valueToFind) { @@ -2641,11 +2641,11 @@ public static BitSet indexesOf(final short[] array, final short valueToFind) { *

A negative startIndex is treated as zero. A startIndex larger than the array * length will return an empty BitSet.

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching * @return a BitSet of all the indices of the value within the array, - * an empty BitSet if not found or {@code null} array input. + * an empty BitSet if not found or {@code null} array input * @since 3.10 */ public static BitSet indexesOf(final short[] array, final short valueToFind, int startIndex) { @@ -2669,9 +2669,9 @@ public static BitSet indexesOf(final short[] array, final short valueToFind, int * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final boolean[] array, final boolean valueToFind) { return indexOf(array, valueToFind, 0); @@ -2686,10 +2686,10 @@ public static int indexOf(final boolean[] array, final boolean valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final boolean[] array, final boolean valueToFind, final int startIndex) { if (isEmpty(array)) { @@ -2709,9 +2709,9 @@ public static int indexOf(final boolean[] array, final boolean valueToFind, fina * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final byte[] array, final byte valueToFind) { return indexOf(array, valueToFind, 0); @@ -2726,10 +2726,10 @@ public static int indexOf(final byte[] array, final byte valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final byte[] array, final byte valueToFind, final int startIndex) { if (isEmpty(array)) { @@ -2749,9 +2749,9 @@ public static int indexOf(final byte[] array, final byte valueToFind, final int * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input * @since 2.1 */ public static int indexOf(final char[] array, final char valueToFind) { @@ -2767,10 +2767,10 @@ public static int indexOf(final char[] array, final char valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input * @since 2.1 */ public static int indexOf(final char[] array, final char valueToFind, final int startIndex) { @@ -2791,9 +2791,9 @@ public static int indexOf(final char[] array, final char valueToFind, final int * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final double[] array, final double valueToFind) { return indexOf(array, valueToFind, 0); @@ -2806,10 +2806,10 @@ public static int indexOf(final double[] array, final double valueToFind) { * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param tolerance tolerance of the search. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param tolerance tolerance of the search + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final double[] array, final double valueToFind, final double tolerance) { return indexOf(array, valueToFind, 0, tolerance); @@ -2824,10 +2824,10 @@ public static int indexOf(final double[] array, final double valueToFind, final * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final double[] array, final double valueToFind, final int startIndex) { if (Double.isNaN(valueToFind)) { @@ -2854,11 +2854,11 @@ public static int indexOf(final double[] array, final double valueToFind, final * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @param tolerance tolerance of the search. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @param tolerance tolerance of the search + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final double[] array, final double valueToFind, final int startIndex, final double tolerance) { if (Double.isNaN(valueToFind)) { @@ -2883,9 +2883,9 @@ public static int indexOf(final double[] array, final double valueToFind, final * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final float[] array, final float valueToFind) { return indexOf(array, valueToFind, 0); @@ -2900,10 +2900,10 @@ public static int indexOf(final float[] array, final float valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final float[] array, final float valueToFind, final int startIndex) { if (isEmpty(array)) { @@ -2925,9 +2925,9 @@ public static int indexOf(final float[] array, final float valueToFind, final in * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final int[] array, final int valueToFind) { return indexOf(array, valueToFind, 0); @@ -2942,10 +2942,10 @@ public static int indexOf(final int[] array, final int valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final int[] array, final int valueToFind, final int startIndex) { if (isEmpty(array)) { @@ -2965,9 +2965,9 @@ public static int indexOf(final int[] array, final int valueToFind, final int st * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final long[] array, final long valueToFind) { return indexOf(array, valueToFind, 0); @@ -2982,10 +2982,10 @@ public static int indexOf(final long[] array, final long valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final long[] array, final long valueToFind, final int startIndex) { if (isEmpty(array)) { @@ -3005,9 +3005,9 @@ public static int indexOf(final long[] array, final long valueToFind, final int * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. - * @return the index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param objectToFind the object to find, may be {@code null} + * @return the index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final Object[] array, final Object objectToFind) { return indexOf(array, objectToFind, 0); @@ -3022,10 +3022,10 @@ public static int indexOf(final Object[] array, final Object objectToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. - * @param startIndex the index to start searching. - * @return the index of the object within the array starting at the index, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param objectToFind the object to find, may be {@code null} + * @param startIndex the index to start searching + * @return the index of the object within the array starting at the index, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final Object[] array, final Object objectToFind, int startIndex) { if (isEmpty(array)) { @@ -3055,8 +3055,8 @@ public static int indexOf(final Object[] array, final Object objectToFind, int s *

* * @param array the array to search for the object, may be {@code null} - * @param valueToFind the value to find. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param valueToFind the value to find + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final short[] array, final short valueToFind) { return indexOf(array, valueToFind, 0); @@ -3071,10 +3071,10 @@ public static int indexOf(final short[] array, final short valueToFind) { * A negative startIndex is treated as zero. A startIndex larger than the array length will return {@link #INDEX_NOT_FOUND} ({@code -1}). *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the index to start searching. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the index to start searching + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int indexOf(final short[] array, final short valueToFind, final int startIndex) { if (isEmpty(array)) { @@ -3090,9 +3090,10 @@ public static int indexOf(final short[] array, final short valueToFind, final in /** * Finds the index of the NaN value in a double array. - * @param array the array to search for NaN, may be {@code null}. - * @param startIndex the index to start searching. - * @return the index of the NaN value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * + * @param array the array to search for NaN, may be {@code null} + * @param startIndex the index to start searching + * @return the index of the NaN value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ private static int indexOfNaN(final double[] array, final int startIndex) { if (isEmpty(array)) { @@ -3119,11 +3120,11 @@ private static int indexOfNaN(final double[] array, final int startIndex) { * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static boolean[] insert(final int index, final boolean[] array, final boolean... values) { @@ -3160,11 +3161,11 @@ public static boolean[] insert(final int index, final boolean[] array, final boo * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static byte[] insert(final int index, final byte[] array, final byte... values) { @@ -3201,11 +3202,11 @@ public static byte[] insert(final int index, final byte[] array, final byte... v * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static char[] insert(final int index, final char[] array, final char... values) { @@ -3242,11 +3243,11 @@ public static char[] insert(final int index, final char[] array, final char... v * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static double[] insert(final int index, final double[] array, final double... values) { @@ -3283,11 +3284,11 @@ public static double[] insert(final int index, final double[] array, final doubl * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static float[] insert(final int index, final float[] array, final float... values) { @@ -3324,11 +3325,11 @@ public static float[] insert(final int index, final float[] array, final float.. * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static int[] insert(final int index, final int[] array, final int... values) { @@ -3365,11 +3366,11 @@ public static int[] insert(final int index, final int[] array, final int... valu * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static long[] insert(final int index, final long[] array, final long... values) { @@ -3406,11 +3407,11 @@ public static long[] insert(final int index, final long[] array, final long... v * ArrayUtils.insert(index, null, values) = null * * - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ public static short[] insert(final int index, final short[] array, final short... values) { @@ -3447,12 +3448,12 @@ public static short[] insert(final int index, final short[] array, final short.. * ArrayUtils.insert(index, null, values) = null * * - * @param The type of elements in {@code array} and {@code values}. - * @param index the position within {@code array} to insert the new values. - * @param array the array to insert the values into, may be {@code null}. - * @param values the new values to insert, may be {@code null}. - * @return The new array or {@code null} if the given array is {@code null}. - * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length}. + * @param the type of elements in {@code array} and {@code values} + * @param index the position within {@code array} to insert the new values + * @param array the array to insert the values into, may be {@code null} + * @param values the new values to insert, may be {@code null} + * @return the new array or {@code null} if the given array is {@code null} + * @throws IndexOutOfBoundsException if {@code array} is provided and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @SafeVarargs @@ -3489,8 +3490,8 @@ public static T[] insert(final int index, final T[] array, final T... values /** * Checks if an array is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} */ private static boolean isArrayEmpty(final Object array) { return getLength(array) == 0; @@ -3505,10 +3506,10 @@ private static boolean isArrayEmpty(final Object array) { * ArrayUtils.isArrayIndexValid(["a"], 0) = true * * - * @param the component type of the array. - * @param array the array to inspect, may be {@code null}. - * @param index the index of the array to be inspected. - * @return Whether the given index is safely-accessible in the given array. + * @param the component type of the array + * @param array the array to inspect, may be {@code null} + * @param index the index of the array to be inspected + * @return whether the given index is safely-accessible in the given array * @since 3.8 */ public static boolean isArrayIndexValid(final T[] array, final int index) { @@ -3518,8 +3519,8 @@ public static boolean isArrayIndexValid(final T[] array, final int index) { /** * Tests whether an array of primitive booleans is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final boolean[] array) { @@ -3529,8 +3530,8 @@ public static boolean isEmpty(final boolean[] array) { /** * Tests whether an array of primitive bytes is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final byte[] array) { @@ -3540,8 +3541,8 @@ public static boolean isEmpty(final byte[] array) { /** * Tests whether an array of primitive chars is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final char[] array) { @@ -3551,8 +3552,8 @@ public static boolean isEmpty(final char[] array) { /** * Tests whether an array of primitive doubles is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final double[] array) { @@ -3562,8 +3563,8 @@ public static boolean isEmpty(final double[] array) { /** * Tests whether an array of primitive floats is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final float[] array) { @@ -3573,8 +3574,8 @@ public static boolean isEmpty(final float[] array) { /** * Tests whether an array of primitive ints is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final int[] array) { @@ -3584,8 +3585,8 @@ public static boolean isEmpty(final int[] array) { /** * Tests whether an array of primitive longs is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final long[] array) { @@ -3595,8 +3596,8 @@ public static boolean isEmpty(final long[] array) { /** * Tests whether an array of Objects is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final Object[] array) { @@ -3606,8 +3607,8 @@ public static boolean isEmpty(final Object[] array) { /** * Tests whether an array of primitive shorts is empty or {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is empty or {@code null}. + * @param array the array to test + * @return {@code true} if the array is empty or {@code null} * @since 2.1 */ public static boolean isEmpty(final short[] array) { @@ -3615,18 +3616,18 @@ public static boolean isEmpty(final short[] array) { } /** - * Tests whether two arrays have equal content, using equals(), handling multidimensional arrays - * correctly. - *

- * Multi-dimensional primitive arrays are also handled correctly by this method. - *

- * - * @param array1 the left-hand side array to compare, may be {@code null}. - * @param array2 the right-hand side array to compare, may be {@code null}. - * @return {@code true} if the arrays are equal. - * @deprecated Replaced by {@code java.util.Objects.deepEquals(Object, Object)} and will be + * Tests whether two arrays have equal content, using equals(), handling multidimensional arrays + * correctly. + *

+ * Multi-dimensional primitive arrays are also handled correctly by this method. + *

+ * + * @param array1 the left-hand side array to compare, may be {@code null} + * @param array2 the right-hand side array to compare, may be {@code null} + * @return {@code true} if the arrays are equal + * @deprecated Replaced by {@code java.util.Objects.deepEquals(Object, Object)} and will be * removed from future releases. - */ + */ @Deprecated public static boolean isEquals(final Object array1, final Object array2) { return new EqualsBuilder().append(array1, array2).isEquals(); @@ -3635,8 +3636,8 @@ public static boolean isEquals(final Object array1, final Object array2) { /** * Tests whether an array of primitive booleans is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final boolean[] array) { @@ -3646,8 +3647,8 @@ public static boolean isNotEmpty(final boolean[] array) { /** * Tests whether an array of primitive bytes is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final byte[] array) { @@ -3657,8 +3658,8 @@ public static boolean isNotEmpty(final byte[] array) { /** * Tests whether an array of primitive chars is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final char[] array) { @@ -3668,8 +3669,8 @@ public static boolean isNotEmpty(final char[] array) { /** * Tests whether an array of primitive doubles is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final double[] array) { @@ -3679,8 +3680,8 @@ public static boolean isNotEmpty(final double[] array) { /** * Tests whether an array of primitive floats is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final float[] array) { @@ -3690,8 +3691,8 @@ public static boolean isNotEmpty(final float[] array) { /** * Tests whether an array of primitive ints is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final int[] array) { @@ -3701,8 +3702,8 @@ public static boolean isNotEmpty(final int[] array) { /** * Tests whether an array of primitive longs is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final long[] array) { @@ -3712,8 +3713,8 @@ public static boolean isNotEmpty(final long[] array) { /** * Tests whether an array of primitive shorts is not empty and not {@code null}. * - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final short[] array) { @@ -3724,8 +3725,8 @@ public static boolean isNotEmpty(final short[] array) { * Tests whether an array of Objects is not empty and not {@code null}. * * @param the component type of the array - * @param array the array to test. - * @return {@code true} if the array is not empty and not {@code null}. + * @param array the array to test + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final T[] array) { @@ -3733,12 +3734,12 @@ public static boolean isNotEmpty(final T[] array) { } /** - * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. - * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. - */ + * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. + * + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array + */ public static boolean isSameLength(final boolean[] array1, final boolean[] array2) { return getLength(array1) == getLength(array2); } @@ -3746,9 +3747,9 @@ public static boolean isSameLength(final boolean[] array1, final boolean[] array /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final byte[] array1, final byte[] array2) { return getLength(array1) == getLength(array2); @@ -3757,9 +3758,9 @@ public static boolean isSameLength(final byte[] array1, final byte[] array2) { /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final char[] array1, final char[] array2) { return getLength(array1) == getLength(array2); @@ -3768,9 +3769,9 @@ public static boolean isSameLength(final char[] array1, final char[] array2) { /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final double[] array1, final double[] array2) { return getLength(array1) == getLength(array2); @@ -3779,9 +3780,9 @@ public static boolean isSameLength(final double[] array1, final double[] array2) /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final float[] array1, final float[] array2) { return getLength(array1) == getLength(array2); @@ -3790,9 +3791,9 @@ public static boolean isSameLength(final float[] array1, final float[] array2) { /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final int[] array1, final int[] array2) { return getLength(array1) == getLength(array2); @@ -3801,9 +3802,9 @@ public static boolean isSameLength(final int[] array1, final int[] array2) { /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final long[] array1, final long[] array2) { return getLength(array1) == getLength(array2); @@ -3815,9 +3816,9 @@ public static boolean isSameLength(final long[] array1, final long[] array2) { * Any multi-dimensional aspects of the arrays are ignored. *

* - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array * @since 3.11 */ public static boolean isSameLength(final Object array1, final Object array2) { @@ -3830,9 +3831,9 @@ public static boolean isSameLength(final Object array1, final Object array2) { * Any multi-dimensional aspects of the arrays are ignored. *

* - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final Object[] array1, final Object[] array2) { return getLength(array1) == getLength(array2); @@ -3841,9 +3842,9 @@ public static boolean isSameLength(final Object[] array1, final Object[] array2) /** * Tests whether two arrays are the same length, treating {@code null} arrays as length {@code 0}. * - * @param array1 the first array, may be {@code null}. - * @param array2 the second array, may be {@code null}. - * @return {@code true} if length of arrays matches, treating {@code null} as an empty array. + * @param array1 the first array, may be {@code null} + * @param array2 the second array, may be {@code null} + * @return {@code true} if length of arrays matches, treating {@code null} as an empty array */ public static boolean isSameLength(final short[] array1, final short[] array2) { return getLength(array1) == getLength(array2); @@ -3852,10 +3853,10 @@ public static boolean isSameLength(final short[] array1, final short[] array2) { /** * Tests whether two arrays are the same type taking into account multidimensional arrays. * - * @param array1 the first array, must not be {@code null}. - * @param array2 the second array, must not be {@code null}. - * @return {@code true} if type of arrays matches. - * @throws IllegalArgumentException if either array is {@code null}. + * @param array1 the first array, must not be {@code null} + * @param array2 the second array, must not be {@code null} + * @return {@code true} if type of arrays matches + * @throws IllegalArgumentException if either array is {@code null} */ public static boolean isSameType(final Object array1, final Object array2) { if (array1 == null || array2 == null) { @@ -3867,8 +3868,8 @@ public static boolean isSameType(final Object array1, final Object array2) { /** * Tests whether whether the provided array is sorted according to natural ordering ({@code false} before {@code true}). * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final boolean[] array) { @@ -3890,8 +3891,8 @@ public static boolean isSorted(final boolean[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final byte[] array) { @@ -3913,8 +3914,8 @@ public static boolean isSorted(final byte[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final char[] array) { @@ -3936,8 +3937,8 @@ public static boolean isSorted(final char[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final double[] array) { @@ -3959,8 +3960,8 @@ public static boolean isSorted(final double[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final float[] array) { @@ -3982,8 +3983,8 @@ public static boolean isSorted(final float[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final int[] array) { @@ -4005,8 +4006,8 @@ public static boolean isSorted(final int[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final long[] array) { @@ -4028,8 +4029,8 @@ public static boolean isSorted(final long[] array) { /** * Tests whether the provided array is sorted according to natural ordering. * - * @param array the array to check. - * @return whether the array is sorted according to natural ordering. + * @param array the array to check + * @return whether the array is sorted according to natural ordering * @since 3.4 */ public static boolean isSorted(final short[] array) { @@ -4052,9 +4053,9 @@ public static boolean isSorted(final short[] array) { * Tests whether the provided array is sorted according to the class's * {@code compareTo} method. * - * @param array the array to check. - * @param the datatype of the array to check, it must implement {@link Comparable}. - * @return whether the array is sorted. + * @param array the array to check + * @param the datatype of the array to check, it must implement {@link Comparable} + * @return whether the array is sorted * @since 3.4 */ public static > boolean isSorted(final T[] array) { @@ -4064,11 +4065,11 @@ public static > boolean isSorted(final T[] array /** * Tests whether the provided array is sorted according to the provided {@link Comparator}. * - * @param array the array to check. - * @param comparator the {@link Comparator} to compare over. - * @param the datatype of the array. - * @return whether the array is sorted. - * @throws NullPointerException if {@code comparator} is {@code null}. + * @param array the array to check + * @param comparator the {@link Comparator} to compare over + * @param the datatype of the array + * @return whether the array is sorted + * @throws NullPointerException if {@code comparator} is {@code null} * @since 3.4 */ public static boolean isSorted(final T[] array, final Comparator comparator) { @@ -4094,9 +4095,9 @@ public static boolean isSorted(final T[] array, final Comparator comparat * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) if {@code null} array input. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final boolean[] array, final boolean valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4111,10 +4112,10 @@ public static int lastIndexOf(final boolean[] array, final boolean valueToFind) * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final boolean[] array, final boolean valueToFind, int startIndex) { if (isEmpty(array) || startIndex < 0) { @@ -4137,9 +4138,9 @@ public static int lastIndexOf(final boolean[] array, final boolean valueToFind, * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final byte[] array, final byte valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4154,10 +4155,10 @@ public static int lastIndexOf(final byte[] array, final byte valueToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final byte[] array, final byte valueToFind, int startIndex) { if (array == null || startIndex < 0) { @@ -4180,9 +4181,9 @@ public static int lastIndexOf(final byte[] array, final byte valueToFind, int st * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input * @since 2.1 */ public static int lastIndexOf(final char[] array, final char valueToFind) { @@ -4198,10 +4199,10 @@ public static int lastIndexOf(final char[] array, final char valueToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input * @since 2.1 */ public static int lastIndexOf(final char[] array, final char valueToFind, int startIndex) { @@ -4225,9 +4226,9 @@ public static int lastIndexOf(final char[] array, final char valueToFind, int st * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final double[] array, final double valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4240,10 +4241,10 @@ public static int lastIndexOf(final double[] array, final double valueToFind) { * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to search for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param tolerance tolerance of the search. - * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to search for the object, may be {@code null} + * @param valueToFind the value to find + * @param tolerance tolerance of the search + * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final double[] array, final double valueToFind, final double tolerance) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE, tolerance); @@ -4258,10 +4259,10 @@ public static int lastIndexOf(final double[] array, final double valueToFind, fi * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final double[] array, final double valueToFind, int startIndex) { if (isEmpty(array) || startIndex < 0) { @@ -4288,11 +4289,11 @@ public static int lastIndexOf(final double[] array, final double valueToFind, in * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @param tolerance search for value within plus/minus this amount. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @param tolerance search for value within plus/minus this amount + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final double[] array, final double valueToFind, int startIndex, final double tolerance) { if (isEmpty(array) || startIndex < 0) { @@ -4317,9 +4318,9 @@ public static int lastIndexOf(final double[] array, final double valueToFind, in * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final float[] array, final float valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4334,10 +4335,10 @@ public static int lastIndexOf(final float[] array, final float valueToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final float[] array, final float valueToFind, int startIndex) { if (isEmpty(array) || startIndex < 0) { @@ -4360,9 +4361,9 @@ public static int lastIndexOf(final float[] array, final float valueToFind, int * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final int[] array, final int valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4377,10 +4378,10 @@ public static int lastIndexOf(final int[] array, final int valueToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final int[] array, final int valueToFind, int startIndex) { if (array == null || startIndex < 0) { @@ -4403,9 +4404,9 @@ public static int lastIndexOf(final int[] array, final int valueToFind, int star * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final long[] array, final long valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4420,10 +4421,10 @@ public static int lastIndexOf(final long[] array, final long valueToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final long[] array, final long valueToFind, int startIndex) { if (array == null || startIndex < 0) { @@ -4446,9 +4447,9 @@ public static int lastIndexOf(final long[] array, final long valueToFind, int st * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. - * @return the last index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param objectToFind the object to find, may be {@code null} + * @return the last index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final Object[] array, final Object objectToFind) { return lastIndexOf(array, objectToFind, Integer.MAX_VALUE); @@ -4463,10 +4464,10 @@ public static int lastIndexOf(final Object[] array, final Object objectToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param objectToFind the object to find, may be {@code null}. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param objectToFind the object to find, may be {@code null} + * @param startIndex the start index to traverse backwards from + * @return the last index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final Object[] array, final Object objectToFind, int startIndex) { if (array == null || startIndex < 0) { @@ -4497,9 +4498,9 @@ public static int lastIndexOf(final Object[] array, final Object objectToFind, i * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. *

* - * @param array the array to traverse backwards looking for the object, may be {@code null}. - * @param valueToFind the object to find. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse backwards looking for the object, may be {@code null} + * @param valueToFind the object to find + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final short[] array, final short valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); @@ -4514,10 +4515,10 @@ public static int lastIndexOf(final short[] array, final short valueToFind) { * A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the end of the array. *

* - * @param array the array to traverse for looking for the object, may be {@code null}. - * @param valueToFind the value to find. - * @param startIndex the start index to traverse backwards from. - * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input. + * @param array the array to traverse for looking for the object, may be {@code null} + * @param valueToFind the value to find + * @param startIndex the start index to traverse backwards from + * @return the last index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input */ public static int lastIndexOf(final short[] array, final short valueToFind, int startIndex) { if (array == null || startIndex < 0) { @@ -4537,14 +4538,14 @@ public static int lastIndexOf(final short[] array, final short valueToFind, int /** * Maps elements from an array into elements of a new array of a given type, while mapping old elements to new elements. * - * @param The input array type. - * @param The output array type. - * @param The type of exceptions thrown when the mapper function fails. - * @param array The input array. - * @param componentType the component type of the result array. - * @param mapper a non-interfering, stateless function to apply to each element. - * @return a new array. - * @throws E Thrown when the mapper function fails. + * @param the input array type + * @param the output array type + * @param the type of exceptions thrown when the mapper function fails + * @param array the input array + * @param componentType the component type of the result array + * @param mapper a non-interfering, stateless function to apply to each element + * @return a new array + * @throws E thrown when the mapper function fails */ private static R[] map(final T[] array, final Class componentType, final FailableFunction mapper) throws E { @@ -4558,11 +4559,11 @@ private static int max0(final int other) { /** * Delegates to {@link Array#newInstance(Class,int)} using generics. * - * @param The array type. - * @param componentType The array class. + * @param the array type + * @param componentType the array class * @param length the array length - * @return The new array. - * @throws NullPointerException if the specified {@code componentType} parameter is null. + * @return the new array + * @throws NullPointerException if the specified {@code componentType} parameter is null * @since 3.13.0 */ @SuppressWarnings("unchecked") // OK, because array and values are of type T @@ -4581,10 +4582,10 @@ public static T[] newInstance(final Class componentType, final int length * the empty {@code public static} references in this class. *

* - * @param The array type. + * @param the array type * @param array the array to check for {@code null} or empty - * @param defaultArray A default array, usually empty. - * @return the same array, or defaultArray if {@code null} or empty input. + * @param defaultArray a default array, usually empty + * @return the same array, or defaultArray if {@code null} or empty input * @since 3.15.0 */ public static T[] nullTo(final T[] array, final T[] defaultArray) { @@ -4602,8 +4603,8 @@ public static T[] nullTo(final T[] array, final T[] defaultArray) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static boolean[] nullToEmpty(final boolean[] array) { @@ -4621,8 +4622,8 @@ public static boolean[] nullToEmpty(final boolean[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Boolean[] nullToEmpty(final Boolean[] array) { @@ -4640,8 +4641,8 @@ public static Boolean[] nullToEmpty(final Boolean[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static byte[] nullToEmpty(final byte[] array) { @@ -4659,8 +4660,8 @@ public static byte[] nullToEmpty(final byte[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Byte[] nullToEmpty(final Byte[] array) { @@ -4678,8 +4679,8 @@ public static Byte[] nullToEmpty(final Byte[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static char[] nullToEmpty(final char[] array) { @@ -4697,8 +4698,8 @@ public static char[] nullToEmpty(final char[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Character[] nullToEmpty(final Character[] array) { @@ -4716,8 +4717,8 @@ public static Character[] nullToEmpty(final Character[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 3.2 */ public static Class[] nullToEmpty(final Class[] array) { @@ -4735,8 +4736,8 @@ public static Class[] nullToEmpty(final Class[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static double[] nullToEmpty(final double[] array) { @@ -4754,8 +4755,8 @@ public static double[] nullToEmpty(final double[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Double[] nullToEmpty(final Double[] array) { @@ -4773,8 +4774,8 @@ public static Double[] nullToEmpty(final Double[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static float[] nullToEmpty(final float[] array) { @@ -4792,8 +4793,8 @@ public static float[] nullToEmpty(final float[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Float[] nullToEmpty(final Float[] array) { @@ -4811,8 +4812,8 @@ public static Float[] nullToEmpty(final Float[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static int[] nullToEmpty(final int[] array) { @@ -4830,8 +4831,8 @@ public static int[] nullToEmpty(final int[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Integer[] nullToEmpty(final Integer[] array) { @@ -4849,8 +4850,8 @@ public static Integer[] nullToEmpty(final Integer[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static long[] nullToEmpty(final long[] array) { @@ -4868,8 +4869,8 @@ public static long[] nullToEmpty(final long[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Long[] nullToEmpty(final Long[] array) { @@ -4887,8 +4888,8 @@ public static Long[] nullToEmpty(final Long[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Object[] nullToEmpty(final Object[] array) { @@ -4906,8 +4907,8 @@ public static Object[] nullToEmpty(final Object[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static short[] nullToEmpty(final short[] array) { @@ -4925,8 +4926,8 @@ public static short[] nullToEmpty(final short[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static Short[] nullToEmpty(final Short[] array) { @@ -4944,8 +4945,8 @@ public static Short[] nullToEmpty(final Short[] array) { * the empty {@code public static} references in this class. *

* - * @param array the array to check for {@code null} or empty. - * @return the same array, {@code public static} empty array if {@code null} or empty input. + * @param array the array to check for {@code null} or empty + * @return the same array, {@code public static} empty array if {@code null} or empty input * @since 2.5 */ public static String[] nullToEmpty(final String[] array) { @@ -4959,11 +4960,11 @@ public static String[] nullToEmpty(final String[] array) { * This method returns an empty array for a {@code null} input array. *

* - * @param array the array to check for {@code null} or empty. - * @param type the class representation of the desired array. - * @param the class type. - * @return the same array, {@code public static} empty array if {@code null}. - * @throws IllegalArgumentException if the type argument is null. + * @param array the array to check for {@code null} or empty + * @param type the class representation of the desired array + * @param the class type + * @return the same array, {@code public static} empty array if {@code null} + * @throws IllegalArgumentException if the type argument is null * @since 3.5 */ public static T[] nullToEmpty(final T[] array, final Class type) { @@ -4979,7 +4980,7 @@ public static T[] nullToEmpty(final T[] array, final Class type) { /** * Gets the {@link ThreadLocalRandom} for {@code shuffle} methods that don't take a {@link Random} argument. * - * @return the current ThreadLocalRandom. + * @return the current ThreadLocalRandom */ private static ThreadLocalRandom random() { return ThreadLocalRandom.current(); @@ -5003,10 +5004,10 @@ private static ThreadLocalRandom random() { * ArrayUtils.remove([true, true, false], 1) = [true, false] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static boolean[] remove(final boolean[] array, final int index) { @@ -5031,10 +5032,10 @@ public static boolean[] remove(final boolean[] array, final int index) { * ArrayUtils.remove([1, 0, 1], 1) = [1, 1] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static byte[] remove(final byte[] array, final int index) { @@ -5059,10 +5060,10 @@ public static byte[] remove(final byte[] array, final int index) { * ArrayUtils.remove(['a', 'b', 'c'], 1) = ['a', 'c'] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static char[] remove(final char[] array, final int index) { @@ -5087,10 +5088,10 @@ public static char[] remove(final char[] array, final int index) { * ArrayUtils.remove([2.5, 6.0, 3.8], 1) = [2.5, 3.8] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static double[] remove(final double[] array, final int index) { @@ -5115,10 +5116,10 @@ public static double[] remove(final double[] array, final int index) { * ArrayUtils.remove([2.5, 6.0, 3.8], 1) = [2.5, 3.8] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static float[] remove(final float[] array, final int index) { @@ -5143,10 +5144,10 @@ public static float[] remove(final float[] array, final int index) { * ArrayUtils.remove([2, 6, 3], 1) = [2, 3] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static int[] remove(final int[] array, final int index) { @@ -5171,10 +5172,10 @@ public static int[] remove(final int[] array, final int index) { * ArrayUtils.remove([2, 6, 3], 1) = [2, 3] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static long[] remove(final long[] array, final int index) { @@ -5192,10 +5193,10 @@ public static long[] remove(final long[] array, final int index) { * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. *

* - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ private static Object remove(final Object array, final int index) { @@ -5229,10 +5230,10 @@ private static Object remove(final Object array, final int index) { * ArrayUtils.remove([2, 6, 3], 1) = [2, 3] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ public static short[] remove(final short[] array, final int index) { @@ -5257,11 +5258,11 @@ public static short[] remove(final short[] array, final int index) { * ArrayUtils.remove(["a", "b", "c"], 1) = ["a", "c"] * * - * @param the component type of the array. - * @param array the array to remove the element from, may not be {@code null}. - * @param index the position of the element to be removed. - * @return A new array containing the existing elements except the element at the specified position. - * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param the component type of the array + * @param array the array to remove the element from, may not be {@code null} + * @param index the position of the element to be removed + * @return a new array containing the existing elements except the element at the specified position + * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 2.1 */ @SuppressWarnings("unchecked") // remove() always creates an array of the same type as its input @@ -5284,10 +5285,10 @@ public static T[] remove(final T[] array, final int index) { * ArrayUtils.removeAll([true, false, true], 1, 2) = [true] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static boolean[] removeAll(final boolean[] array, final int... indices) { @@ -5313,10 +5314,10 @@ public static boolean[] removeAll(final boolean[] array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static byte[] removeAll(final byte[] array, final int... indices) { @@ -5342,10 +5343,10 @@ public static byte[] removeAll(final byte[] array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static char[] removeAll(final char[] array, final int... indices) { @@ -5371,10 +5372,10 @@ public static char[] removeAll(final char[] array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static double[] removeAll(final double[] array, final int... indices) { @@ -5400,10 +5401,10 @@ public static double[] removeAll(final double[] array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static float[] removeAll(final float[] array, final int... indices) { @@ -5429,10 +5430,10 @@ public static float[] removeAll(final float[] array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static int[] removeAll(final int[] array, final int... indices) { @@ -5458,10 +5459,10 @@ public static int[] removeAll(final int[] array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static long[] removeAll(final long[] array, final int... indices) { @@ -5540,10 +5541,10 @@ static Object removeAll(final Object array, final int... indices) { * ArrayUtils.removeAll([2, 6, 3], 0, 1, 2) = [] * * - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ public static short[] removeAll(final short[] array, final int... indices) { @@ -5565,11 +5566,11 @@ public static short[] removeAll(final short[] array, final int... indices) { * ArrayUtils.removeAll(["a", "b", "c"], 1, 2) = ["a"] * * - * @param the component type of the array. - * @param array the array to remove the element from, may not be {@code null}. - * @param indices the positions of the elements to be removed. - * @return A new array containing the existing elements except those at the specified positions. - * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}. + * @param the component type of the array + * @param array the array to remove the element from, may not be {@code null} + * @param indices the positions of the elements to be removed + * @return a new array containing the existing elements except those at the specified positions + * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null} * @since 3.0.1 */ @SuppressWarnings("unchecked") // removeAll() always creates an array of the same type as its input @@ -5585,9 +5586,9 @@ public static T[] removeAll(final T[] array, final int... indices) { * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(boolean[], boolean)}. */ @@ -5604,9 +5605,9 @@ public static boolean[] removeAllOccurences(final boolean[] array, final boolean * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(byte[], byte)}. */ @@ -5623,9 +5624,9 @@ public static byte[] removeAllOccurences(final byte[] array, final byte element) * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(char[], char)}. */ @@ -5642,9 +5643,9 @@ public static char[] removeAllOccurences(final char[] array, final char element) * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(double[], double)}. */ @@ -5661,9 +5662,9 @@ public static double[] removeAllOccurences(final double[] array, final double el * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(float[], float)}. */ @@ -5680,9 +5681,9 @@ public static float[] removeAllOccurences(final float[] array, final float eleme * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(int[], int)}. */ @@ -5699,9 +5700,9 @@ public static int[] removeAllOccurences(final int[] array, final int element) { * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(long[], long)}. */ @@ -5718,9 +5719,9 @@ public static long[] removeAllOccurences(final long[] array, final long element) * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(short[], short)}. */ @@ -5737,10 +5738,10 @@ public static short[] removeAllOccurences(final short[] array, final short eleme * {@code null} will be returned if the input array is {@code null}. *

* - * @param the type of object in the array, may be {@code null}. - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove, may be {@code null}. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param the type of object in the array, may be {@code null} + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove, may be {@code null} + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.5 * @deprecated Use {@link #removeAllOccurrences(Object[], Object)}. */ @@ -5757,9 +5758,9 @@ public static T[] removeAllOccurences(final T[] array, final T element) { * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static boolean[] removeAllOccurrences(final boolean[] array, final boolean element) { @@ -5774,9 +5775,9 @@ public static boolean[] removeAllOccurrences(final boolean[] array, final boolea * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static byte[] removeAllOccurrences(final byte[] array, final byte element) { @@ -5791,9 +5792,9 @@ public static byte[] removeAllOccurrences(final byte[] array, final byte element * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static char[] removeAllOccurrences(final char[] array, final char element) { @@ -5808,9 +5809,9 @@ public static char[] removeAllOccurrences(final char[] array, final char element * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static double[] removeAllOccurrences(final double[] array, final double element) { @@ -5825,9 +5826,9 @@ public static double[] removeAllOccurrences(final double[] array, final double e * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static float[] removeAllOccurrences(final float[] array, final float element) { @@ -5842,9 +5843,9 @@ public static float[] removeAllOccurrences(final float[] array, final float elem * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static int[] removeAllOccurrences(final int[] array, final int element) { @@ -5859,9 +5860,9 @@ public static int[] removeAllOccurrences(final int[] array, final int element) { * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static long[] removeAllOccurrences(final long[] array, final long element) { @@ -5876,9 +5877,9 @@ public static long[] removeAllOccurrences(final long[] array, final long element * {@code null} will be returned if the input array is {@code null}. *

* - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static short[] removeAllOccurrences(final short[] array, final short element) { @@ -5893,10 +5894,10 @@ public static short[] removeAllOccurrences(final short[] array, final short elem * {@code null} will be returned if the input array is {@code null}. *

* - * @param the type of object in the array, may be {@code null}. - * @param array the input array, will not be modified, and may be {@code null}. - * @param element the element to remove, may be {@code null}. - * @return A new array containing the existing elements except the occurrences of the specified element. + * @param the type of object in the array, may be {@code null} + * @param array the input array, will not be modified, and may be {@code null} + * @param element the element to remove, may be {@code null} + * @return a new array containing the existing elements except the occurrences of the specified element * @since 3.10 */ public static T[] removeAllOccurrences(final T[] array, final T element) { @@ -5906,9 +5907,9 @@ public static T[] removeAllOccurrences(final T[] array, final T element) { /** * Removes multiple array elements specified by indices. * - * @param array the input array, will not be modified, and may be {@code null}. - * @param indices to remove. - * @return new array of same type minus elements specified by the set bits in {@code indices}. + * @param array the input array, will not be modified, and may be {@code null} + * @param indices to remove + * @return new array of same type minus elements specified by the set bits in {@code indices} */ // package protected for access by unit tests static Object removeAt(final Object array, final BitSet indices) { @@ -5962,10 +5963,10 @@ static Object removeAt(final Object array, final BitSet indices) { * ArrayUtils.removeElement([true, false, true], true) = [false, true] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static boolean[] removeElement(final boolean[] array, final boolean element) { @@ -5992,10 +5993,10 @@ public static boolean[] removeElement(final boolean[] array, final boolean eleme * ArrayUtils.removeElement([1, 0, 1], 1) = [0, 1] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static byte[] removeElement(final byte[] array, final byte element) { @@ -6022,10 +6023,10 @@ public static byte[] removeElement(final byte[] array, final byte element) { * ArrayUtils.removeElement(['a', 'b', 'a'], 'a') = ['b', 'a'] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static char[] removeElement(final char[] array, final char element) { @@ -6052,10 +6053,10 @@ public static char[] removeElement(final char[] array, final char element) { * ArrayUtils.removeElement([1.1, 2.3, 1.1], 1.1) = [2.3, 1.1] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static double[] removeElement(final double[] array, final double element) { @@ -6082,10 +6083,10 @@ public static double[] removeElement(final double[] array, final double element) * ArrayUtils.removeElement([1.1, 2.3, 1.1], 1.1) = [2.3, 1.1] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static float[] removeElement(final float[] array, final float element) { @@ -6112,10 +6113,10 @@ public static float[] removeElement(final float[] array, final float element) { * ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static int[] removeElement(final int[] array, final int element) { @@ -6142,10 +6143,10 @@ public static int[] removeElement(final int[] array, final int element) { * ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static long[] removeElement(final long[] array, final long element) { @@ -6172,10 +6173,10 @@ public static long[] removeElement(final long[] array, final long element) { * ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1] * * - * @param array the input array, may be {@code null}. - * @param element the element to be removed. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static short[] removeElement(final short[] array, final short element) { @@ -6203,10 +6204,10 @@ public static short[] removeElement(final short[] array, final short element) { * * * @param the component type of the array - * @param array the input array, may be {@code null}. - * @param element the element to be removed, may be {@code null}. - * @return A new array containing the existing elements except the first - * occurrence of the specified element. + * @param array the input array, may be {@code null} + * @param element the element to be removed, may be {@code null} + * @return a new array containing the existing elements except the first + * occurrence of the specified element * @since 2.1 */ public static T[] removeElement(final T[] array, final Object element) { @@ -6235,10 +6236,10 @@ public static T[] removeElement(final T[] array, final Object element) { * ArrayUtils.removeElements([true, false, true], true, true) = [false] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static boolean[] removeElements(final boolean[] array, final boolean... values) { @@ -6284,10 +6285,10 @@ public static boolean[] removeElements(final boolean[] array, final boolean... v * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static byte[] removeElements(final byte[] array, final byte... values) { @@ -6333,10 +6334,10 @@ public static byte[] removeElements(final byte[] array, final byte... values) { * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static char[] removeElements(final char[] array, final char... values) { @@ -6382,10 +6383,10 @@ public static char[] removeElements(final char[] array, final char... values) { * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static double[] removeElements(final double[] array, final double... values) { @@ -6431,10 +6432,10 @@ public static double[] removeElements(final double[] array, final double... valu * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static float[] removeElements(final float[] array, final float... values) { @@ -6480,10 +6481,10 @@ public static float[] removeElements(final float[] array, final float... values) * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static int[] removeElements(final int[] array, final int... values) { @@ -6529,10 +6530,10 @@ public static int[] removeElements(final int[] array, final int... values) { * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static long[] removeElements(final long[] array, final long... values) { @@ -6578,10 +6579,10 @@ public static long[] removeElements(final long[] array, final long... values) { * ArrayUtils.removeElements([1, 3, 1], 1, 1) = [3] * * - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ public static short[] removeElements(final short[] array, final short... values) { @@ -6628,10 +6629,10 @@ public static short[] removeElements(final short[] array, final short... values) * * * @param the component type of the array - * @param array the input array, will not be modified, and may be {@code null}. - * @param values the values to be removed. - * @return A new array containing the existing elements except the - * earliest-encountered occurrences of the specified elements. + * @param array the input array, will not be modified, and may be {@code null} + * @param values the values to be removed + * @return a new array containing the existing elements except the + * earliest-encountered occurrences of the specified elements * @since 3.0.1 */ @SafeVarargs @@ -6665,7 +6666,7 @@ public static T[] removeElements(final T[] array, final T... values) { * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final boolean[] array) { if (array != null) { @@ -6680,7 +6681,7 @@ public static void reverse(final boolean[] array) { *

* * @param array - * the array to reverse, may be {@code null}. + * the array to reverse, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -6711,7 +6712,7 @@ public static void reverse(final boolean[] array, final int startIndexInclusive, * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final byte[] array) { if (array != null) { @@ -6725,7 +6726,7 @@ public static void reverse(final byte[] array) { * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no change. * @param endIndexExclusive elements up to endIndex-1 are reversed in the array. Undervalue (< start index) results in no change. Overvalue * (>array.length) is demoted to array length. @@ -6753,7 +6754,7 @@ public static void reverse(final byte[] array, final int startIndexInclusive, fi * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final char[] array) { if (array != null) { @@ -6767,7 +6768,7 @@ public static void reverse(final char[] array) { * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no change. * @param endIndexExclusive elements up to endIndex-1 are reversed in the array. Undervalue (< start index) results in no change. Overvalue * (>array.length) is demoted to array length. @@ -6795,7 +6796,7 @@ public static void reverse(final char[] array, final int startIndexInclusive, fi * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null} + * @param array the array to reverse, may be {@code null} */ public static void reverse(final double[] array) { if (array != null) { @@ -6809,7 +6810,7 @@ public static void reverse(final double[] array) { * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no change. * @param endIndexExclusive elements up to endIndex-1 are reversed in the array. Undervalue (< start index) results in no change. Overvalue * (>array.length) is demoted to array length. @@ -6837,7 +6838,7 @@ public static void reverse(final double[] array, final int startIndexInclusive, * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final float[] array) { if (array != null) { @@ -6851,7 +6852,7 @@ public static void reverse(final float[] array) { * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no change. * @param endIndexExclusive elements up to endIndex-1 are reversed in the array. Undervalue (< start index) results in no change. Overvalue * (>array.length) is demoted to array length. @@ -6879,7 +6880,7 @@ public static void reverse(final float[] array, final int startIndexInclusive, f * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final int[] array) { if (array != null) { @@ -6894,7 +6895,7 @@ public static void reverse(final int[] array) { *

* * @param array - * the array to reverse, may be {@code null}. + * the array to reverse, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -6925,7 +6926,7 @@ public static void reverse(final int[] array, final int startIndexInclusive, fin * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final long[] array) { if (array != null) { @@ -6940,7 +6941,7 @@ public static void reverse(final long[] array) { *

* * @param array - * the array to reverse, may be {@code null}. + * the array to reverse, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -6974,7 +6975,7 @@ public static void reverse(final long[] array, final int startIndexInclusive, fi * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final Object[] array) { if (array != null) { @@ -6989,7 +6990,7 @@ public static void reverse(final Object[] array) { *

* * @param array - * the array to reverse, may be {@code null}. + * the array to reverse, may be {@code null} * @param startIndexInclusive * the starting index. Under value (<0) is promoted to 0, over value (>array.length) results in no * change. @@ -7020,7 +7021,7 @@ public static void reverse(final Object[] array, final int startIndexInclusive, * This method does nothing for a {@code null} input array. *

* - * @param array the array to reverse, may be {@code null}. + * @param array the array to reverse, may be {@code null} */ public static void reverse(final short[] array) { if (array != null) { @@ -7035,7 +7036,7 @@ public static void reverse(final short[] array) { *

* * @param array - * the array to reverse, may be {@code null}. + * the array to reverse, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7067,9 +7068,9 @@ public static void reverse(final short[] array, final int startIndexInclusive, f * state. *

* - * @param type of elements of the array, may be {@code null}. - * @param array array to be initialized, may be {@code null}. - * @param generator a function accepting an index and producing the desired value for that position. + * @param type of elements of the array, may be {@code null} + * @param array array to be initialized, may be {@code null} + * @param generator a function accepting an index and producing the desired value for that position * @return the input array * @since 3.13.0 */ @@ -7087,9 +7088,9 @@ public static T[] setAll(final T[] array, final IntFunction gen * state. *

* - * @param type of elements of the array, may be {@code null}. - * @param array array to be initialized, may be {@code null}. - * @param generator a function accepting an index and producing the desired value for that position. + * @param type of elements of the array, may be {@code null} + * @param array array to be initialized, may be {@code null} + * @param generator a function accepting an index and producing the desired value for that position * @return the input array * @since 3.13.0 */ @@ -7108,7 +7109,7 @@ public static T[] setAll(final T[] array, final Supplier genera *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7127,7 +7128,7 @@ public static void shift(final boolean[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7178,7 +7179,7 @@ public static void shift(final boolean[] array, int startIndexInclusive, int end *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7197,7 +7198,7 @@ public static void shift(final byte[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7248,7 +7249,7 @@ public static void shift(final byte[] array, int startIndexInclusive, int endInd *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7267,7 +7268,7 @@ public static void shift(final char[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7318,7 +7319,7 @@ public static void shift(final char[] array, int startIndexInclusive, int endInd *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7337,7 +7338,7 @@ public static void shift(final double[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7388,7 +7389,7 @@ public static void shift(final double[] array, int startIndexInclusive, int endI *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7407,7 +7408,7 @@ public static void shift(final float[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7458,7 +7459,7 @@ public static void shift(final float[] array, int startIndexInclusive, int endIn *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7477,7 +7478,7 @@ public static void shift(final int[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7528,7 +7529,7 @@ public static void shift(final int[] array, int startIndexInclusive, int endInde *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7547,7 +7548,7 @@ public static void shift(final long[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7598,7 +7599,7 @@ public static void shift(final long[] array, int startIndexInclusive, int endInd *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7617,7 +7618,7 @@ public static void shift(final Object[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7668,7 +7669,7 @@ public static void shift(final Object[] array, int startIndexInclusive, int endI *

There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.

* - * @param array the array to shift, may be {@code null}. + * @param array the array to shift, may be {@code null} * @param offset * The number of positions to rotate the elements. If the offset is larger than the number of elements to * rotate, than the effective offset is modulo the number of elements to rotate. @@ -7687,7 +7688,7 @@ public static void shift(final short[] array, final int offset) { * does nothing for {@code null} or empty input arrays.

* * @param array - * the array to shift, may be {@code null}. + * the array to shift, may be {@code null} * @param startIndexInclusive * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. @@ -7743,7 +7744,7 @@ public static void shift(final short[] array, int startIndexInclusive, int endIn * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7755,8 +7756,8 @@ public static void shuffle(final boolean[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7779,7 +7780,7 @@ public static void shuffle(final boolean[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7791,8 +7792,8 @@ public static void shuffle(final byte[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7815,7 +7816,7 @@ public static void shuffle(final byte[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7827,8 +7828,8 @@ public static void shuffle(final char[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7851,7 +7852,7 @@ public static void shuffle(final char[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7863,8 +7864,8 @@ public static void shuffle(final double[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7887,7 +7888,7 @@ public static void shuffle(final double[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7899,8 +7900,8 @@ public static void shuffle(final float[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7923,7 +7924,7 @@ public static void shuffle(final float[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7935,8 +7936,8 @@ public static void shuffle(final int[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7959,7 +7960,7 @@ public static void shuffle(final int[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7971,8 +7972,8 @@ public static void shuffle(final long[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -7995,7 +7996,7 @@ public static void shuffle(final long[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -8007,8 +8008,8 @@ public static void shuffle(final Object[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -8031,7 +8032,7 @@ public static void shuffle(final Object[] array, final Random random) { * with a {@link SecureRandom} argument. *

* - * @param array the array to shuffle. + * @param array the array to shuffle * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -8043,8 +8044,8 @@ public static void shuffle(final short[] array) { * Shuffles randomly the elements of the specified array using the Fisher-Yates shuffle * algorithm. * - * @param array the array to shuffle, no-op if {@code null}. - * @param random the source of randomness used to permute the elements, no-op if {@code null}. + * @param array the array to shuffle, no-op if {@code null} + * @param random the source of randomness used to permute the elements, no-op if {@code null} * @see Fisher-Yates shuffle algorithm * @since 3.6 */ @@ -8062,9 +8063,9 @@ public static void shuffle(final short[] array, final Random random) { * If both arrays are null, the method returns true. The method return false when one array is null and the other not. *

* - * @param data The data to search, maybe larger than the expected data. - * @param expected The expected data to find. - * @return whether a match was found. + * @param data the data to search, maybe larger than the expected data + * @param expected the expected data to find + * @return whether a match was found * @since 3.18.0 */ public static boolean startsWith(final byte[] data, final byte[] expected) { @@ -8097,13 +8098,13 @@ public static boolean startsWith(final byte[] data, final byte[] expected) { * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(boolean[], int, int) + * @since 2.1 */ public static boolean[] subarray(final boolean[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8124,13 +8125,13 @@ public static boolean[] subarray(final boolean[] array, int startIndexInclusive, * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(byte[], int, int) + * @since 2.1 */ public static byte[] subarray(final byte[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8151,13 +8152,13 @@ public static byte[] subarray(final byte[] array, int startIndexInclusive, int e * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(char[], int, int) + * @since 2.1 */ public static char[] subarray(final char[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8178,13 +8179,13 @@ public static char[] subarray(final char[] array, int startIndexInclusive, int e * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(double[], int, int) + * @since 2.1 */ public static double[] subarray(final double[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8205,13 +8206,13 @@ public static double[] subarray(final double[] array, int startIndexInclusive, i * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(float[], int, int) + * @since 2.1 */ public static float[] subarray(final float[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8232,13 +8233,13 @@ public static float[] subarray(final float[] array, int startIndexInclusive, int * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(int[], int, int) + * @since 2.1 */ public static int[] subarray(final int[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8259,13 +8260,13 @@ public static int[] subarray(final int[] array, int startIndexInclusive, int end * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(long[], int, int) + * @since 2.1 */ public static long[] subarray(final long[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8286,13 +8287,13 @@ public static long[] subarray(final long[] array, int startIndexInclusive, int e * The start index is inclusive, the end index exclusive. Null array input produces null output. *

* - * @param array the input array. + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(short[], int, int) + * @since 2.1 */ public static short[] subarray(final short[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8322,14 +8323,14 @@ public static short[] subarray(final short[] array, int startIndexInclusive, int * Date[] someDates = (Date[]) ArrayUtils.subarray(allDates, 2, 5); * * - * @param the component type of the array. - * @param array the input array. + * @param the component type of the array + * @param array the input array * @param startIndexInclusive the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array. * @param endIndexExclusive elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue * (>array.length) is demoted to array length. - * @return a new array containing the elements between the start and end indices. - * @since 2.1 + * @return a new array containing the elements between the start and end indices * @see Arrays#copyOfRange(Object[], int, int) + * @since 2.1 */ public static T[] subarray(final T[] array, int startIndexInclusive, int endIndexExclusive) { if (array == null) { @@ -8361,9 +8362,9 @@ public static T[] subarray(final T[] array, int startIndexInclusive, int end *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final boolean[] array, final int offset1, final int offset2) { @@ -8388,10 +8389,10 @@ public static void swap(final boolean[] array, final int offset1, final int offs *
  • ArrayUtils.swap([true, false, true, false], 0, 3, 3) -> [false, false, true, true]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final boolean[] array, int offset1, int offset2, int len) { @@ -8424,9 +8425,9 @@ public static void swap(final boolean[] array, int offset1, int offset2, int len *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final byte[] array, final int offset1, final int offset2) { @@ -8451,10 +8452,10 @@ public static void swap(final byte[] array, final int offset1, final int offset2 *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final byte[] array, int offset1, int offset2, int len) { @@ -8487,9 +8488,9 @@ public static void swap(final byte[] array, int offset1, int offset2, int len) { *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final char[] array, final int offset1, final int offset2) { @@ -8514,10 +8515,10 @@ public static void swap(final char[] array, final int offset1, final int offset2 *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final char[] array, int offset1, int offset2, int len) { @@ -8550,9 +8551,9 @@ public static void swap(final char[] array, int offset1, int offset2, int len) { *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final double[] array, final int offset1, final int offset2) { @@ -8577,10 +8578,10 @@ public static void swap(final double[] array, final int offset1, final int offse *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final double[] array, int offset1, int offset2, int len) { @@ -8613,9 +8614,9 @@ public static void swap(final double[] array, int offset1, int offset2, int len *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final float[] array, final int offset1, final int offset2) { @@ -8640,10 +8641,10 @@ public static void swap(final float[] array, final int offset1, final int offset *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final float[] array, int offset1, int offset2, int len) { @@ -8677,9 +8678,9 @@ public static void swap(final float[] array, int offset1, int offset2, int len) *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final int[] array, final int offset1, final int offset2) { @@ -8704,10 +8705,10 @@ public static void swap(final int[] array, final int offset1, final int offset2) *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final int[] array, int offset1, int offset2, int len) { @@ -8740,9 +8741,9 @@ public static void swap(final int[] array, int offset1, int offset2, int len) { *
  • ArrayUtils.swap([true, false, true], -1, 1) -> [false, true, true]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final long[] array, final int offset1, final int offset2) { @@ -8767,10 +8768,10 @@ public static void swap(final long[] array, final int offset1, final int offset2 *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final long[] array, int offset1, int offset2, int len) { @@ -8803,9 +8804,9 @@ public static void swap(final long[] array, int offset1, int offset2, int len) *
  • ArrayUtils.swap(["1", "2", "3"], -1, 1) -> ["2", "1", "3"]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final Object[] array, final int offset1, final int offset2) { @@ -8830,10 +8831,10 @@ public static void swap(final Object[] array, final int offset1, final int offse *
  • ArrayUtils.swap(["1", "2", "3", "4"], 0, 3, 3) -> ["4", "2", "3", "1"]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final Object[] array, int offset1, int offset2, int len) { @@ -8866,9 +8867,9 @@ public static void swap(final Object[] array, int offset1, int offset2, int len *
  • ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element to swap. - * @param offset2 the index of the second element to swap. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element to swap + * @param offset2 the index of the second element to swap * @since 3.5 */ public static void swap(final short[] array, final int offset1, final int offset2) { @@ -8893,10 +8894,10 @@ public static void swap(final short[] array, final int offset1, final int offset *
  • ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]
  • * * - * @param array the array to swap, may be {@code null}. - * @param offset1 the index of the first element in the series to swap. - * @param offset2 the index of the second element in the series to swap. - * @param len the number of elements to swap starting with the given indices. + * @param array the array to swap, may be {@code null} + * @param offset1 the index of the first element in the series to swap + * @param offset2 the index of the second element in the series to swap + * @param len the number of elements to swap starting with the given indices * @since 3.5 */ public static void swap(final short[] array, int offset1, int offset2, int len) { @@ -8922,12 +8923,12 @@ public static void swap(final short[] array, int offset1, int offset2, int len) * The Java language does not allow an array to be created from a generic type: *

    *
    -    public static <T> T[] createAnArray(int size) {
    -        return new T[size]; // compiler error here
    -    }
    -    public static <T> T[] createAnArray(int size) {
    -        return (T[]) new Object[size]; // ClassCastException at runtime
    -    }
    +     * public static <T> T[] createAnArray(int size) {
    +     * return new T[size]; // compiler error here
    +     * }
    +     * public static <T> T[] createAnArray(int size) {
    +     * return (T[]) new Object[size]; // ClassCastException at runtime
    +     * }
          * 
    *

    * Therefore new arrays of generic types can be created with this method. @@ -8950,9 +8951,9 @@ public static void swap(final short[] array, int offset1, int offset2, int len) * {@code new Number[] {Integer.valueOf(42), Double.valueOf(Math.PI)}}. *

    * - * @param the array's element type. - * @param items the varargs array items, null allowed. - * @return the array, not null unless a null array is passed in. + * @param the array's element type + * @param items the varargs array items, null allowed + * @return the array, not null unless a null array is passed in * @since 3.0 */ public static T[] toArray(@SuppressWarnings("unchecked") final T... items) { @@ -8975,10 +8976,10 @@ public static T[] toArray(@SuppressWarnings("unchecked") final T... items) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array an array whose elements are either a {@link java.util.Map.Entry} or an Array containing at least two elements, may be {@code null}. - * @return a {@link Map} that was created from the array. - * @throws IllegalArgumentException if one element of this Array is itself an Array containing less than two elements. - * @throws IllegalArgumentException if the array contains elements other than {@link java.util.Map.Entry} and an Array. + * @param array an array whose elements are either a {@link java.util.Map.Entry} or an Array containing at least two elements, may be {@code null} + * @return a {@link Map} that was created from the array + * @throws IllegalArgumentException if one element of this Array is itself an Array containing less than two elements + * @throws IllegalArgumentException if the array contains elements other than {@link java.util.Map.Entry} and an Array */ public static Map toMap(final Object[] array) { if (array == null) { @@ -9012,8 +9013,8 @@ public static Map toMap(final Object[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code boolean} array. - * @return a {@link Boolean} array, {@code null} if null array input. + * @param array a {@code boolean} array + * @return a {@link Boolean} array, {@code null} if null array input */ public static Boolean[] toObject(final boolean[] array) { if (array == null) { @@ -9030,8 +9031,8 @@ public static Boolean[] toObject(final boolean[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code byte} array. - * @return a {@link Byte} array, {@code null} if null array input. + * @param array a {@code byte} array + * @return a {@link Byte} array, {@code null} if null array input */ public static Byte[] toObject(final byte[] array) { if (array == null) { @@ -9048,8 +9049,8 @@ public static Byte[] toObject(final byte[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code char} array. - * @return a {@link Character} array, {@code null} if null array input. + * @param array a {@code char} array + * @return a {@link Character} array, {@code null} if null array input */ public static Character[] toObject(final char[] array) { if (array == null) { @@ -9066,8 +9067,8 @@ public static Character[] toObject(final char[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code double} array. - * @return a {@link Double} array, {@code null} if null array input. + * @param array a {@code double} array + * @return a {@link Double} array, {@code null} if null array input */ public static Double[] toObject(final double[] array) { if (array == null) { @@ -9084,8 +9085,8 @@ public static Double[] toObject(final double[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code float} array. - * @return a {@link Float} array, {@code null} if null array input. + * @param array a {@code float} array + * @return a {@link Float} array, {@code null} if null array input */ public static Float[] toObject(final float[] array) { if (array == null) { @@ -9102,8 +9103,8 @@ public static Float[] toObject(final float[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array an {@code int} array. - * @return an {@link Integer} array, {@code null} if null array input. + * @param array an {@code int} array + * @return an {@link Integer} array, {@code null} if null array input */ public static Integer[] toObject(final int[] array) { if (array == null) { @@ -9120,8 +9121,8 @@ public static Integer[] toObject(final int[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code long} array. - * @return a {@link Long} array, {@code null} if null array input. + * @param array a {@code long} array + * @return a {@link Long} array, {@code null} if null array input */ public static Long[] toObject(final long[] array) { if (array == null) { @@ -9138,8 +9139,8 @@ public static Long[] toObject(final long[] array) { * *

    This method returns {@code null} for a {@code null} input array.

    * - * @param array a {@code short} array. - * @return a {@link Short} array, {@code null} if null array input. + * @param array a {@code short} array + * @return a {@link Short} array, {@code null} if null array input */ public static Short[] toObject(final short[] array) { if (array == null) { @@ -9160,8 +9161,8 @@ public static Short[] toObject(final short[] array) { * Null array elements map to false, like {@code Boolean.parseBoolean(null)} and its callers return false. *

    * - * @param array a {@link Boolean} array, may be {@code null}. - * @return a {@code boolean} array, {@code null} if null array input. + * @param array a {@link Boolean} array, may be {@code null} + * @return a {@code boolean} array, {@code null} if null array input */ public static boolean[] toPrimitive(final Boolean[] array) { return toPrimitive(array, false); @@ -9173,9 +9174,9 @@ public static boolean[] toPrimitive(final Boolean[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Boolean} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code boolean} array, {@code null} if null array input. + * @param array a {@link Boolean} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code boolean} array, {@code null} if null array input */ public static boolean[] toPrimitive(final Boolean[] array, final boolean valueForNull) { if (array == null) { @@ -9198,9 +9199,9 @@ public static boolean[] toPrimitive(final Boolean[] array, final boolean valueFo * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Byte} array, may be {@code null}. - * @return a {@code byte} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Byte} array, may be {@code null} + * @return a {@code byte} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static byte[] toPrimitive(final Byte[] array) { if (array == null) { @@ -9222,9 +9223,9 @@ public static byte[] toPrimitive(final Byte[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Byte} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code byte} array, {@code null} if null array input. + * @param array a {@link Byte} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code byte} array, {@code null} if null array input */ public static byte[] toPrimitive(final Byte[] array, final byte valueForNull) { if (array == null) { @@ -9247,9 +9248,9 @@ public static byte[] toPrimitive(final Byte[] array, final byte valueForNull) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Character} array, may be {@code null}. - * @return a {@code char} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Character} array, may be {@code null} + * @return a {@code char} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static char[] toPrimitive(final Character[] array) { if (array == null) { @@ -9271,9 +9272,9 @@ public static char[] toPrimitive(final Character[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Character} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code char} array, {@code null} if null array input. + * @param array a {@link Character} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code char} array, {@code null} if null array input */ public static char[] toPrimitive(final Character[] array, final char valueForNull) { if (array == null) { @@ -9296,9 +9297,9 @@ public static char[] toPrimitive(final Character[] array, final char valueForNul * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Double} array, may be {@code null}. - * @return a {@code double} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Double} array, may be {@code null} + * @return a {@code double} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static double[] toPrimitive(final Double[] array) { if (array == null) { @@ -9320,9 +9321,9 @@ public static double[] toPrimitive(final Double[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Double} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code double} array, {@code null} if null array input. + * @param array a {@link Double} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code double} array, {@code null} if null array input */ public static double[] toPrimitive(final Double[] array, final double valueForNull) { if (array == null) { @@ -9345,9 +9346,9 @@ public static double[] toPrimitive(final Double[] array, final double valueForNu * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Float} array, may be {@code null}. - * @return a {@code float} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Float} array, may be {@code null} + * @return a {@code float} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static float[] toPrimitive(final Float[] array) { if (array == null) { @@ -9369,9 +9370,9 @@ public static float[] toPrimitive(final Float[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Float} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code float} array, {@code null} if null array input. + * @param array a {@link Float} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code float} array, {@code null} if null array input */ public static float[] toPrimitive(final Float[] array, final float valueForNull) { if (array == null) { @@ -9394,9 +9395,9 @@ public static float[] toPrimitive(final Float[] array, final float valueForNull) * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Integer} array, may be {@code null}. - * @return an {@code int} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Integer} array, may be {@code null} + * @return an {@code int} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static int[] toPrimitive(final Integer[] array) { if (array == null) { @@ -9418,9 +9419,9 @@ public static int[] toPrimitive(final Integer[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Integer} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return an {@code int} array, {@code null} if null array input. + * @param array a {@link Integer} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return an {@code int} array, {@code null} if null array input */ public static int[] toPrimitive(final Integer[] array, final int valueForNull) { if (array == null) { @@ -9443,9 +9444,9 @@ public static int[] toPrimitive(final Integer[] array, final int valueForNull) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Long} array, may be {@code null}. - * @return a {@code long} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Long} array, may be {@code null} + * @return a {@code long} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static long[] toPrimitive(final Long[] array) { if (array == null) { @@ -9467,9 +9468,9 @@ public static long[] toPrimitive(final Long[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Long} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code long} array, {@code null} if null array input. + * @param array a {@link Long} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code long} array, {@code null} if null array input */ public static long[] toPrimitive(final Long[] array, final long valueForNull) { if (array == null) { @@ -9492,8 +9493,8 @@ public static long[] toPrimitive(final Long[] array, final long valueForNull) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array an array of wrapper object. - * @return an array of the corresponding primitive type, or the original array. + * @param array an array of wrapper object + * @return an array of the corresponding primitive type, or the original array * @since 3.5 */ public static Object toPrimitive(final Object array) { @@ -9535,9 +9536,9 @@ public static Object toPrimitive(final Object array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Short} array, may be {@code null}. - * @return a {@code byte} array, {@code null} if null array input. - * @throws NullPointerException if an array element is {@code null}. + * @param array a {@link Short} array, may be {@code null} + * @return a {@code byte} array, {@code null} if null array input + * @throws NullPointerException if an array element is {@code null} */ public static short[] toPrimitive(final Short[] array) { if (array == null) { @@ -9559,9 +9560,9 @@ public static short[] toPrimitive(final Short[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array a {@link Short} array, may be {@code null}. - * @param valueForNull the value to insert if {@code null} found. - * @return a {@code byte} array, {@code null} if null array input. + * @param array a {@link Short} array, may be {@code null} + * @param valueForNull the value to insert if {@code null} found + * @return a {@code byte} array, {@code null} if null array input */ public static short[] toPrimitive(final Short[] array, final short valueForNull) { if (array == null) { @@ -9588,8 +9589,8 @@ public static short[] toPrimitive(final Short[] array, final short valueForNull) * The format is that of Java source code, for example {@code {a,b}}. *

    * - * @param array the array to get a toString for, may be {@code null}. - * @return a String representation of the array, '{}' if null array input. + * @param array the array to get a toString for, may be {@code null} + * @return a String representation of the array, '{}' if null array input */ public static String toString(final Object array) { return toString(array, "{}"); @@ -9605,9 +9606,9 @@ public static String toString(final Object array) { * The format is that of Java source code, for example {@code {a,b}}. *

    * - * @param array the array to get a toString for, may be {@code null}. - * @param stringIfNull the String to return if the array is {@code null}. - * @return a String representation of the array. + * @param array the array to get a toString for, may be {@code null} + * @param stringIfNull the String to return if the array is {@code null} + * @return a String representation of the array */ public static String toString(final Object array, final String stringIfNull) { return array != null ? new ToStringBuilder(array, ToStringStyle.SIMPLE_STYLE).append(array).toString() : stringIfNull; @@ -9619,8 +9620,8 @@ public static String toString(final Object array, final String stringIfNull) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array the {@code Object[]} to be processed, may be {@code null}. - * @return {@code String[]} of the same size as the source with its element's string representation, {@code null} if null array input. + * @param array the {@code Object[]} to be processed, may be {@code null} + * @return {@code String[]} of the same size as the source with its element's string representation, {@code null} if null array input * @since 3.6 */ public static String[] toStringArray(final Object[] array) { @@ -9633,9 +9634,9 @@ public static String[] toStringArray(final Object[] array) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array the Object[] to be processed, may be {@code null}. - * @param valueForNullElements the value to insert if {@code null} is found. - * @return a {@link String} array, {@code null} if null array input. + * @param array the Object[] to be processed, may be {@code null} + * @param valueForNullElements the value to insert if {@code null} is found + * @return a {@link String} array, {@code null} if null array input * @since 3.6 */ public static String[] toStringArray(final Object[] array, final String valueForNullElements) { diff --git a/src/main/java/org/apache/commons/lang3/BitField.java b/src/main/java/org/apache/commons/lang3/BitField.java index d8412021884..d073597346c 100644 --- a/src/main/java/org/apache/commons/lang3/BitField.java +++ b/src/main/java/org/apache/commons/lang3/BitField.java @@ -100,8 +100,8 @@ public BitField(final long mask) { /** * Clears the bits. * - * @param holder the int data containing the bits we're interested in. - * @return the value of holder with the specified bits cleared (set to {@code 0}). + * @param holder the int data containing the bits we're interested in + * @return the value of holder with the specified bits cleared (set to {@code 0}) */ public int clear(final int holder) { return (int) (holder & ~mask); @@ -110,8 +110,8 @@ public int clear(final int holder) { /** * Clears the bits. * - * @param holder the long data containing the bits we're interested in. - * @return the value of holder with the specified bits cleared (set to {@code 0}). + * @param holder the long data containing the bits we're interested in + * @return the value of holder with the specified bits cleared (set to {@code 0}) * @since 3.21.0 */ public long clear(final long holder) { @@ -121,8 +121,8 @@ public long clear(final long holder) { /** * Clears the bits. * - * @param holder the byte data containing the bits we're interested in. - * @return the value of holder with the specified bits cleared (set to {@code 0}). + * @param holder the byte data containing the bits we're interested in + * @return the value of holder with the specified bits cleared (set to {@code 0}) */ public byte clearByte(final byte holder) { return (byte) clear(holder); @@ -131,8 +131,8 @@ public byte clearByte(final byte holder) { /** * Clears the bits. * - * @param holder the short data containing the bits we're interested in. - * @return the value of holder with the specified bits cleared (set to {@code 0}). + * @param holder the short data containing the bits we're interested in + * @return the value of holder with the specified bits cleared (set to {@code 0}) */ public short clearShort(final short holder) { return (short) clear(holder); @@ -141,8 +141,8 @@ public short clearShort(final short holder) { /** * Gets the value for the specified BitField, unshifted. * - * @param holder the int data containing the bits we're interested in. - * @return the selected bits. + * @param holder the int data containing the bits we're interested in + * @return the selected bits */ public int getRawValue(final int holder) { return (int) (holder & mask); @@ -151,8 +151,8 @@ public int getRawValue(final int holder) { /** * Gets the value for the specified BitField, unshifted. * - * @param holder the long data containing the bits we're interested in. - * @return the selected bits. + * @param holder the long data containing the bits we're interested in + * @return the selected bits * @since 3.21.0 */ public long getRawValue(final long holder) { @@ -162,8 +162,8 @@ public long getRawValue(final long holder) { /** * Obtains the value for the specified BitField, unshifted. * - * @param holder the short data containing the bits we're interested in. - * @return the selected bits. + * @param holder the short data containing the bits we're interested in + * @return the selected bits */ public short getShortRawValue(final short holder) { return (short) getRawValue(holder); @@ -176,8 +176,8 @@ public short getShortRawValue(final short holder) { * so shifted left so many bits). *

    * - * @param holder the short data containing the bits we're interested in. - * @return the selected bits, shifted right appropriately. + * @param holder the short data containing the bits we're interested in + * @return the selected bits, shifted right appropriately * @see #setShortValue(short,short) */ public short getShortValue(final short holder) { @@ -191,8 +191,8 @@ public short getShortValue(final short holder) { * so shifted left so many bits). *

    * - * @param holder the int data containing the bits we're interested in. - * @return the selected bits, shifted right appropriately. + * @param holder the int data containing the bits we're interested in + * @return the selected bits, shifted right appropriately * @see #setValue(int,int) */ public int getValue(final int holder) { @@ -206,8 +206,8 @@ public int getValue(final int holder) { * so shifted left so many bits). *

    * - * @param holder the long data containing the bits we're interested in. - * @return the selected bits, shifted right appropriately. + * @param holder the long data containing the bits we're interested in + * @return the selected bits, shifted right appropriately * @see #setValue(long,long) * @since 3.21.0 */ @@ -221,8 +221,8 @@ public long getValue(final long holder) { * This is a stricter test than {@link #isSet(int)}, in that all of the bits in a multi-bit set must be set for this method to return {@code true}. *

    * - * @param holder the int data containing the bits we're interested in. - * @return {@code true} if all of the bits are set, else {@code false}. + * @param holder the int data containing the bits we're interested in + * @return {@code true} if all of the bits are set, else {@code false} */ public boolean isAllSet(final int holder) { return (holder & mask) == mask; @@ -234,8 +234,8 @@ public boolean isAllSet(final int holder) { * This is a stricter test than {@link #isSet(long)}, in that all of the bits in a multi-bit set must be set for this method to return {@code true}. *

    * - * @param holder the long data containing the bits we're interested in. - * @return {@code true} if all of the bits are set, else {@code false}. + * @param holder the long data containing the bits we're interested in + * @return {@code true} if all of the bits are set, else {@code false} * @since 3.21.0 */ public boolean isAllSet(final long holder) { @@ -274,8 +274,8 @@ public boolean isSet(final long holder) { /** * Sets the bits. * - * @param holder the int data containing the bits we're interested in. - * @return the value of holder with the specified bits set to {@code 1}. + * @param holder the int data containing the bits we're interested in + * @return the value of holder with the specified bits set to {@code 1} */ public int set(final int holder) { return (int) (holder | mask); @@ -284,8 +284,8 @@ public int set(final int holder) { /** * Sets the bits. * - * @param holder the long data containing the bits we're interested in. - * @return the value of holder with the specified bits set to {@code 1}. + * @param holder the long data containing the bits we're interested in + * @return the value of holder with the specified bits set to {@code 1} * @since 3.21.0 */ public long set(final long holder) { @@ -295,9 +295,9 @@ public long set(final long holder) { /** * Sets a boolean BitField. * - * @param holder the int data containing the bits we're interested in. - * @param flag indicating whether to set or clear the bits. - * @return the value of holder with the specified bits set or cleared. + * @param holder the int data containing the bits we're interested in + * @param flag indicating whether to set or clear the bits + * @return the value of holder with the specified bits set or cleared */ public int setBoolean(final int holder, final boolean flag) { return flag ? set(holder) : clear(holder); @@ -306,9 +306,9 @@ public int setBoolean(final int holder, final boolean flag) { /** * Sets a boolean BitField. * - * @param holder the long data containing the bits we're interested in. - * @param flag indicating whether to set or clear the bits. - * @return the value of holder with the specified bits set or cleared. + * @param holder the long data containing the bits we're interested in + * @param flag indicating whether to set or clear the bits + * @return the value of holder with the specified bits set or cleared * @since 3.21.0 */ public long setBoolean(final long holder, final boolean flag) { @@ -328,9 +328,9 @@ public byte setByte(final byte holder) { /** * Sets a boolean BitField. * - * @param holder the byte data containing the bits we're interested in. - * @param flag indicating whether to set or clear the bits. - * @return the value of holder with the specified bits set or cleared. + * @param holder the byte data containing the bits we're interested in + * @param flag indicating whether to set or clear the bits + * @return the value of holder with the specified bits set or cleared */ public byte setByteBoolean(final byte holder, final boolean flag) { return flag ? setByte(holder) : clearByte(holder); @@ -339,8 +339,8 @@ public byte setByteBoolean(final byte holder, final boolean flag) { /** * Sets the bits. * - * @param holder the short data containing the bits we're interested in. - * @return the value of holder with the specified bits set to {@code 1}. + * @param holder the short data containing the bits we're interested in + * @return the value of holder with the specified bits set to {@code 1} */ public short setShort(final short holder) { return (short) set(holder); @@ -349,9 +349,9 @@ public short setShort(final short holder) { /** * Sets a boolean BitField. * - * @param holder the short data containing the bits we're interested in. - * @param flag indicating whether to set or clear the bits. - * @return the value of holder with the specified bits set or cleared. + * @param holder the short data containing the bits we're interested in + * @param flag indicating whether to set or clear the bits + * @return the value of holder with the specified bits set or cleared */ public short setShortBoolean(final short holder, final boolean flag) { return flag ? setShort(holder) : clearShort(holder); @@ -372,9 +372,9 @@ public short setShortValue(final short holder, final short value) { /** * Sets the bits with new values. * - * @param holder the int data containing the bits we're interested in. - * @param value the new value for the specified bits. - * @return the value of holder with the bits from the value parameter replacing the old bits. + * @param holder the int data containing the bits we're interested in + * @param value the new value for the specified bits + * @return the value of holder with the bits from the value parameter replacing the old bits * @see #getValue(int) */ public int setValue(final int holder, final int value) { @@ -384,9 +384,9 @@ public int setValue(final int holder, final int value) { /** * Sets the bits with new values. * - * @param holder the long data containing the bits we're interested in. - * @param value the new value for the specified bits. - * @return the value of holder with the bits from the value parameter replacing the old bits. + * @param holder the long data containing the bits we're interested in + * @param value the new value for the specified bits + * @return the value of holder with the bits from the value parameter replacing the old bits * @see #getValue(long) * @since 3.21.0 */ diff --git a/src/main/java/org/apache/commons/lang3/BooleanUtils.java b/src/main/java/org/apache/commons/lang3/BooleanUtils.java index 7cb0c3e9285..b81e6b80572 100644 --- a/src/main/java/org/apache/commons/lang3/BooleanUtils.java +++ b/src/main/java/org/apache/commons/lang3/BooleanUtils.java @@ -94,8 +94,8 @@ public class BooleanUtils { * @param array an array of {@code boolean}s * @return the result of the logical 'and' operation. That is {@code false} * if any of the parameters is {@code false} and {@code true} otherwise. + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. * @since 3.0.1 */ public static boolean and(final boolean... array) { @@ -126,8 +126,8 @@ public static boolean and(final boolean... array) { * @param array an array of {@link Boolean}s * @return the result of the logical 'and' operation. That is {@code false} * if any of the parameters is {@code false} and {@code true} otherwise. + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. * @since 3.0.1 */ public static Boolean and(final Boolean... array) { @@ -138,7 +138,7 @@ public static Boolean and(final Boolean... array) { /** * Returns a new array of possible values (like an enum would). * - * @return a new array of possible values (like an enum would). + * @return a new array of possible values (like an enum would) * @since 3.12.0 */ public static Boolean[] booleanValues() { @@ -165,7 +165,7 @@ public static int compare(final boolean x, final boolean y) { /** * Performs the given action for each Boolean {@link BooleanUtils#values()}. * - * @param action The action to be performed for each element + * @param action the action to be performed for each element * @since 3.13.0 */ public static void forEach(final Consumer action) { @@ -279,8 +279,8 @@ public static Boolean negate(final Boolean bool) { * * @param array an array of {@code boolean}s * @return the result of the one-hot operations + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. */ public static boolean oneHot(final boolean... array) { ObjectUtils.requireNonEmpty(array, "array"); @@ -310,8 +310,8 @@ public static boolean oneHot(final boolean... array) { * * @param array an array of {@code boolean}s * @return the result of the one-hot operations + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. */ public static Boolean oneHot(final Boolean... array) { return Boolean.valueOf(oneHot(ArrayUtils.toPrimitive(array))); @@ -330,9 +330,9 @@ public static Boolean oneHot(final Boolean... array) { * * * @param array an array of {@code boolean}s - * @return {@code true} if any of the arguments is {@code true}, and it returns {@code false} otherwise. + * @return {@code true} if any of the arguments is {@code true}, and it returns {@code false} otherwise + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. * @since 3.0.1 */ public static boolean or(final boolean... array) { @@ -363,9 +363,9 @@ public static boolean or(final boolean... array) { *

    * * @param array an array of {@link Boolean}s - * @return {@code true} if any of the arguments is {@code true}, and it returns {@code false} otherwise. + * @return {@code true} if any of the arguments is {@code true}, and it returns {@code false} otherwise + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. * @since 3.0.1 */ public static Boolean or(final Boolean... array) { @@ -376,7 +376,7 @@ public static Boolean or(final Boolean... array) { /** * Returns a new array of possible values (like an enum would). * - * @return a new array of possible values (like an enum would). + * @return a new array of possible values (like an enum would) * @since 3.12.0 */ public static boolean[] primitiveValues() { @@ -660,7 +660,7 @@ public static Boolean toBooleanObject(final Integer value) { * *

    The checks are done first for the {@code trueValue}, then for the {@code falseValue} and * finally for the {@code nullValue}.

    - ** + * * *
          *   BooleanUtils.toBooleanObject(Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(3)) = Boolean.TRUE
          *   BooleanUtils.toBooleanObject(Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(3)) = Boolean.TRUE
    @@ -1147,7 +1147,7 @@ public static String toStringYesNo(final Boolean bool) {
         /**
          * Returns an unmodifiable list of Booleans {@code [false, true]}.
          *
    -     * @return an unmodifiable list of Booleans {@code [false, true]}.
    +     * @return an unmodifiable list of Booleans {@code [false, true]}
          * @since 3.13.0
          */
         public static List values() {
    @@ -1172,9 +1172,9 @@ public static List values() {
          * 
    * * @param array an array of {@code boolean}s - * @return true if the number of true values in the array is odd; otherwise returns false. + * @return true if the number of true values in the array is odd; otherwise returns false + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. */ public static boolean xor(final boolean... array) { ObjectUtils.requireNonEmpty(array, "array"); @@ -1203,8 +1203,8 @@ public static boolean xor(final boolean... array) { * * @param array an array of {@link Boolean}s * @return the result of the xor operations + * @throws IllegalArgumentException if {@code array} is empty * @throws NullPointerException if {@code array} is {@code null} - * @throws IllegalArgumentException if {@code array} is empty. */ public static Boolean xor(final Boolean... array) { ObjectUtils.requireNonEmpty(array, "array"); diff --git a/src/main/java/org/apache/commons/lang3/CachedRandomBits.java b/src/main/java/org/apache/commons/lang3/CachedRandomBits.java index 62904c34627..19fedd85b88 100644 --- a/src/main/java/org/apache/commons/lang3/CachedRandomBits.java +++ b/src/main/java/org/apache/commons/lang3/CachedRandomBits.java @@ -46,13 +46,13 @@ final class CachedRandomBits { */ private static final int MAX_CACHE_SIZE = Integer.MAX_VALUE >> 3; - /** Maximum number of bits that can be generated (size of an int) */ + /** Maximum number of bits that can be generated (size of an int). */ private static final int MAX_BITS = 32; - /** Mask to extract the bit offset within a byte (0-7) */ + /** Mask to extract the bit offset within a byte (0-7). */ private static final int BIT_INDEX_MASK = 0x7; - /** Number of bits in a byte */ + /** Number of bits in a byte. */ private static final int BITS_PER_BYTE = 8; private final Random random; private final byte[] cache; diff --git a/src/main/java/org/apache/commons/lang3/CharRange.java b/src/main/java/org/apache/commons/lang3/CharRange.java index a43ade931d9..2ee67054bd0 100644 --- a/src/main/java/org/apache/commons/lang3/CharRange.java +++ b/src/main/java/org/apache/commons/lang3/CharRange.java @@ -29,7 +29,7 @@ *

    #ThreadSafe#

    * * @since 1.0 - * @since 3.20.1 {@code serialVersionUID} changed from {@code 8270183163158333422L} to {@code 2L}. + * @since 3.20.1 {@code serialVersionUID} changed from {@code 8270183163158333422L} to {@code 2L} */ // TODO: This is no longer public and will be removed later as CharSet is moved // to depend on Range. @@ -41,7 +41,7 @@ final class CharRange implements Iterable, Serializable { */ private static final class CharacterIterator implements Iterator { - /** The current character */ + /** The current character. */ private char current; private final CharRange range; @@ -50,7 +50,7 @@ private static final class CharacterIterator implements Iterator { /** * Constructs a new iterator for the character range. * - * @param r The character range. + * @param r the character range */ private CharacterIterator(final CharRange r) { range = r; @@ -75,7 +75,7 @@ private CharacterIterator(final CharRange r) { /** * Tests whether this iterator reached the end character. * - * @return {@code true} if the iterator has yet to reach the character date. + * @return {@code true} if the iterator has yet to reach the character date */ @Override public boolean hasNext() { @@ -85,7 +85,7 @@ public boolean hasNext() { /** * Returns the next character in the iteration. * - * @return {@link Character} for the next character. + * @return {@link Character} for the next character */ @Override public Character next() { @@ -123,7 +123,7 @@ private void prepareNext() { /** * Always throws UnsupportedOperationException. * - * @throws UnsupportedOperationException Always thrown. + * @throws UnsupportedOperationException always thrown * @see java.util.Iterator#remove() */ @Override @@ -136,7 +136,7 @@ public void remove() { * Required for serialization support. Lang version 2.0. * * @see java.io.Serializable - * @since 3.20.1 {@code serialVersionUID} changed from {@code 8270183163158333422L} to {@value}. + * @since 3.20.1 {@code serialVersionUID} changed from {@code 8270183163158333422L} to {@value} */ private static final long serialVersionUID = 2L; @@ -146,8 +146,8 @@ public void remove() { /** * Constructs a {@link CharRange} over a single character. * - * @param ch only character in this range. - * @return the new CharRange object. + * @param ch only character in this range + * @return the new CharRange object * @since 2.5 */ public static CharRange is(final char ch) { @@ -160,9 +160,9 @@ public static CharRange is(final char ch) { *

    If start and end are in the wrong order, they are reversed. * Thus {@code a-e} is the same as {@code e-a}.

    * - * @param start first character, inclusive, in this range. - * @param end last character, inclusive, in this range. - * @return the new CharRange object. + * @param start first character, inclusive, in this range + * @param end last character, inclusive, in this range + * @return the new CharRange object * @since 2.5 */ public static CharRange isIn(final char start, final char end) { @@ -175,8 +175,8 @@ public static CharRange isIn(final char start, final char end) { *

    A negated range includes everything except that defined by the * single character.

    * - * @param ch only character in this range. - * @return the new CharRange object. + * @param ch only character in this range + * @return the new CharRange object * @since 2.5 */ public static CharRange isNot(final char ch) { @@ -192,9 +192,9 @@ public static CharRange isNot(final char ch) { *

    If start and end are in the wrong order, they are reversed. * Thus {@code a-e} is the same as {@code e-a}.

    * - * @param start first character, inclusive, in this range. - * @param end last character, inclusive, in this range. - * @return the new CharRange object. + * @param start first character, inclusive, in this range + * @param end last character, inclusive, in this range + * @return the new CharRange object * @since 2.5 */ public static CharRange isNotIn(final char start, final char end) { @@ -223,9 +223,9 @@ public static CharRange isNotIn(final char start, final char end) { *

    If start and end are in the wrong order, they are reversed. * Thus {@code a-e} is the same as {@code e-a}.

    * - * @param start first character, inclusive, in this range. - * @param end last character, inclusive, in this range. - * @param negated true to express everything except the range. + * @param start first character, inclusive, in this range + * @param end last character, inclusive, in this range + * @param negated true to express everything except the range */ private CharRange(char start, char end, final boolean negated) { if (start > end) { @@ -242,8 +242,8 @@ private CharRange(char start, char end, final boolean negated) { /** * Is the character specified contained in this range. * - * @param ch the character to check. - * @return {@code true} if this range contains the input character. + * @param ch the character to check + * @return {@code true} if this range contains the input character */ public boolean contains(final char ch) { return (ch >= start && ch <= end) != negated; @@ -253,9 +253,9 @@ public boolean contains(final char ch) { * Are all the characters of the passed in range contained in * this range. * - * @param range the range to check against. - * @return {@code true} if this range entirely contains the input range. - * @throws NullPointerException if {@code null} input. + * @param range the range to check against + * @return {@code true} if this range entirely contains the input range + * @throws NullPointerException if {@code null} input */ public boolean contains(final CharRange range) { Objects.requireNonNull(range, "range"); @@ -275,8 +275,8 @@ public boolean contains(final CharRange range) { * Compares two CharRange objects, returning true if they represent * exactly the same range of characters defined in the same way. * - * @param obj the object to compare to. - * @return true if equal. + * @param obj the object to compare to + * @return true if equal */ @Override public boolean equals(final Object obj) { @@ -293,7 +293,7 @@ public boolean equals(final Object obj) { /** * Gets the end character for this character range. * - * @return the end char (inclusive). + * @return the end char (inclusive) */ public char getEnd() { return this.end; @@ -302,7 +302,7 @@ public char getEnd() { /** * Gets the start character for this character range. * - * @return the start char (inclusive). + * @return the start char (inclusive) */ public char getStart() { return this.start; @@ -311,7 +311,7 @@ public char getStart() { /** * Gets a hashCode compatible with the equals method. * - * @return a suitable hashCode. + * @return a suitable hashCode */ @Override public int hashCode() { @@ -324,7 +324,7 @@ public int hashCode() { *

    A negated range includes everything except that defined by the * start and end characters.

    * - * @return {@code true} if negated. + * @return {@code true} if negated */ public boolean isNegated() { return negated; @@ -346,7 +346,7 @@ public Iterator iterator() { /** * Gets a string representation of the character range. * - * @return string representation of this range. + * @return string representation of this range */ @Override public String toString() { diff --git a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java index a3e274ca905..387f656f06a 100644 --- a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java @@ -41,10 +41,10 @@ private static boolean checkLaterThan1(final CharSequence cs, final CharSequence /** * Used by the indexOf(CharSequence methods) as a green implementation of indexOf. * - * @param cs the {@link CharSequence} to be processed. - * @param searchChar the {@link CharSequence} to be searched for. - * @param start the start index. - * @return the index where the search sequence was found, or {@code -1} if there is no such occurrence. + * @param cs the {@link CharSequence} to be processed + * @param searchChar the {@link CharSequence} to be searched for + * @param start the start index + * @return the index where the search sequence was found, or {@code -1} if there is no such occurrence */ static int indexOf(final CharSequence cs, final CharSequence searchChar, final int start) { if (cs == null || searchChar == null) { @@ -101,11 +101,11 @@ static int indexOf(final CharSequence cs, final CharSequence searchChar, final i * All indices are specified in {@code char} values (Unicode code units). *

    * - * @param cs the {@link CharSequence} to be processed, not null. - * @param searchChar the char to be searched for. - * @param start the start index, negative starts at the string start. - * @return the index where the search char was found, -1 if not found. - * @since 3.6 updated to behave more like {@link String}. + * @param cs the {@link CharSequence} to be processed, not null + * @param searchChar the char to be searched for + * @param start the start index, negative starts at the string start + * @return the index where the search char was found, -1 if not found + * @since 3.6 updated to behave more like {@link String} */ static int indexOf(final CharSequence cs, final int searchChar, int start) { if (cs instanceof String) { @@ -138,12 +138,12 @@ static int indexOf(final CharSequence cs, final int searchChar, int start) { } /** - * Used by the lastIndexOf(CharSequence methods) as a green implementation of lastIndexOf + * Used by the lastIndexOf(CharSequence methods) as a green implementation of lastIndexOf. * - * @param cs the {@link CharSequence} to be processed. - * @param searchChar the {@link CharSequence} to find. - * @param start the start index. - * @return the index where the search sequence was found. + * @param cs the {@link CharSequence} to be processed + * @param searchChar the {@link CharSequence} to find + * @param start the start index + * @return the index where the search sequence was found */ static int lastIndexOf(final CharSequence cs, final CharSequence searchChar, int start) { if (searchChar == null || cs == null) { @@ -236,11 +236,11 @@ static int lastIndexOf(final CharSequence cs, final CharSequence searchChar, int * All indices are specified in {@code char} values (Unicode code units). *

    * - * @param cs the {@link CharSequence} to be processed. - * @param searchChar the char to be searched for. - * @param start the start index, negative returns -1, beyond length starts at end. - * @return the index where the search char was found, -1 if not found. - * @since 3.6 updated to behave more like {@link String}. + * @param cs the {@link CharSequence} to be processed + * @param searchChar the char to be searched for + * @param start the start index, negative returns -1, beyond length starts at end + * @return the index where the search char was found, -1 if not found + * @since 3.6 updated to behave more like {@link String} */ static int lastIndexOf(final CharSequence cs, final int searchChar, int start) { if (cs instanceof String) { @@ -283,13 +283,13 @@ static int lastIndexOf(final CharSequence cs, final int searchChar, int start) { /** * Tests if two string regions are equal. * - * @param cs the {@link CharSequence} to be processed. - * @param ignoreCase whether or not to be case-insensitive. - * @param thisStart the index to start on the {@code cs} CharSequence. - * @param substring the {@link CharSequence} to be looked for. - * @param start the index to start on the {@code substring} CharSequence. - * @param length character length of the region. - * @return whether the region matched. + * @param cs the {@link CharSequence} to be processed + * @param ignoreCase whether or not to be case-insensitive + * @param thisStart the index to start on the {@code cs} CharSequence + * @param substring the {@link CharSequence} to be looked for + * @param start the index to start on the {@code substring} CharSequence + * @param length character length of the region + * @return whether the region matched * @see String#regionMatches(boolean, int, String, int, int) */ static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, final int thisStart, final CharSequence substring, final int start, @@ -339,11 +339,11 @@ static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, fi * The length (in {@code char}) of the returned sequence is {@code length() - start}, * so if {@code start == end} then an empty sequence is returned.

    * - * @param cs the specified subsequence, null returns null. - * @param start the start index, inclusive, valid. - * @return a new subsequence, may be null. + * @param cs the specified subsequence, null returns null + * @param start the start index, inclusive, valid + * @return a new subsequence, may be null * @throws IndexOutOfBoundsException if {@code start} is negative or if - * {@code start} is greater than {@code length()}. + * {@code start} is greater than {@code length()} */ public static CharSequence subSequence(final CharSequence cs, final int start) { return cs == null ? null : cs.subSequence(start, cs.length()); @@ -352,8 +352,8 @@ public static CharSequence subSequence(final CharSequence cs, final int start) { /** * Converts the given CharSequence to a char[]. * - * @param source the {@link CharSequence} to be processed. - * @return the resulting char array, never null. + * @param source the {@link CharSequence} to be processed + * @return the resulting char array, never null * @since 3.11 */ public static char[] toCharArray(final CharSequence source) { diff --git a/src/main/java/org/apache/commons/lang3/CharSet.java b/src/main/java/org/apache/commons/lang3/CharSet.java index a97a54d567e..b8530ab124e 100644 --- a/src/main/java/org/apache/commons/lang3/CharSet.java +++ b/src/main/java/org/apache/commons/lang3/CharSet.java @@ -79,7 +79,7 @@ public class CharSet implements Serializable { /** * A Map of the common cases used in the factory. - * Subclasses can add more common patterns if desired + * Subclasses can add more common patterns if desired. * * @since 2.0 */ @@ -152,7 +152,7 @@ public class CharSet implements Serializable { * *

    All CharSet objects returned by this method will be immutable.

    * - * @param setStrs Strings to merge into the set, may be null + * @param setStrs strings to merge into the set, may be null * @return a CharSet instance * @since 2.4 */ @@ -176,7 +176,7 @@ public static CharSet getInstance(final String... setStrs) { * Constructs a new CharSet using the set syntax. * Each string is merged in with the set. * - * @param set Strings to merge into the initial set + * @param set strings to merge into the initial set * @throws NullPointerException if set is {@code null} */ protected CharSet(final String... set) { @@ -186,7 +186,7 @@ protected CharSet(final String... set) { /** * Add a set definition string to the {@link CharSet}. * - * @param str set definition string + * @param str set definition string */ protected void add(final String str) { if (str == null) { diff --git a/src/main/java/org/apache/commons/lang3/CharSetUtils.java b/src/main/java/org/apache/commons/lang3/CharSetUtils.java index d8dd4aa2124..166048e339e 100644 --- a/src/main/java/org/apache/commons/lang3/CharSetUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSetUtils.java @@ -45,10 +45,10 @@ public class CharSetUtils { * CharSetUtils.containsAny("hello", "a-d") = false * * - * @see CharSet#getInstance(String...) for set-syntax. - * @param str String to look for characters in, may be null - * @param set String[] set of characters to identify, may be null + * @param str string to look for characters in, may be null + * @param set string[] set of characters to identify, may be null * @return whether or not the characters in the set are in the primary string + * @see CharSet#getInstance(String...) for set-syntax * @since 3.2 */ public static boolean containsAny(final String str, final String... set) { @@ -77,10 +77,10 @@ public static boolean containsAny(final String str, final String... set) { * CharSetUtils.count("hello", "a-e") = 1 * * - * @see CharSet#getInstance(String...) for set-syntax. - * @param str String to count characters in, may be null - * @param set String[] set of characters to count, may be null + * @param str string to count characters in, may be null + * @param set string[] set of characters to count, may be null * @return the character count, zero if null string input + * @see CharSet#getInstance(String...) for set-syntax */ public static int count(final String str, final String... set) { if (isEmpty(str, set)) { @@ -100,7 +100,7 @@ public static int count(final String str, final String... set) { * Determines whether or not all the Strings in an array are * empty or not. * - * @param strings String[] whose elements are being checked for emptiness + * @param strings string[] whose elements are being checked for emptiness * @return whether or not the String is empty */ private static boolean deepEmpty(final String[] strings) { @@ -120,10 +120,10 @@ private static boolean deepEmpty(final String[] strings) { * CharSetUtils.delete("hello", "le") = "ho" * * - * @see CharSet#getInstance(String...) for set-syntax. - * @param str String to delete characters from, may be null - * @param set String[] set of characters to delete, may be null + * @param str string to delete characters from, may be null + * @param set string[] set of characters to delete, may be null * @return the modified String, {@code null} if null string input + * @see CharSet#getInstance(String...) for set-syntax */ public static String delete(final String str, final String... set) { if (isEmpty(str, set)) { @@ -149,10 +149,10 @@ private static boolean isEmpty(final String str, final String... set) { * CharSetUtils.keep("hello", "le") = "ell" * * - * @see CharSet#getInstance(String...) for set-syntax. - * @param str String to keep characters from, may be null - * @param set String[] set of characters to keep, may be null + * @param str string to keep characters from, may be null + * @param set string[] set of characters to keep, may be null * @return the modified String, {@code null} if null string input + * @see CharSet#getInstance(String...) for set-syntax * @since 2.0 */ public static String keep(final String str, final String... set) { @@ -168,8 +168,8 @@ public static String keep(final String str, final String... set) { /** * Implements delete and keep. * - * @param str String to modify characters within - * @param set String[] set of characters to modify + * @param str string to modify characters within + * @param set string[] set of characters to modify * @param expect whether to evaluate on match, or non-match * @return the modified String, not null */ @@ -198,10 +198,10 @@ private static String modify(final String str, final String[] set, final boolean * CharSetUtils.squeeze("hello", "a-e") = "hello" * * - * @see CharSet#getInstance(String...) for set-syntax. * @param str the string to squeeze, may be null * @param set the character set to use for manipulation, may be null * @return the modified String, {@code null} if null string input + * @see CharSet#getInstance(String...) for set-syntax */ public static String squeeze(final String str, final String... set) { if (isEmpty(str, set)) { diff --git a/src/main/java/org/apache/commons/lang3/CharUtils.java b/src/main/java/org/apache/commons/lang3/CharUtils.java index fda1bf6184e..e8d4f8896b0 100644 --- a/src/main/java/org/apache/commons/lang3/CharUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharUtils.java @@ -245,8 +245,8 @@ public static boolean isAsciiPrintable(final char ch) { * CharUtils.isHex('©') = false * * - * @param ch the character to test. - * @return true if character is a hexadecimal character. + * @param ch the character to test + * @return true if character is a hexadecimal character * @since 3.18.0 */ public static boolean isHex(final char ch) { @@ -311,8 +311,8 @@ public static char toChar(final Character ch, final char defaultValue) { * * @param str the character to convert * @return the char value of the first letter of the String - * @throws NullPointerException if the string is null * @throws IllegalArgumentException if the String is empty + * @throws NullPointerException if the string is null */ public static char toChar(final String str) { Validate.notEmpty(str, "The String must not be empty"); @@ -342,7 +342,7 @@ public static char toChar(final String str, final char defaultValue) { * Delegates to {@link Character#valueOf(char)}. * * @param c the character to convert - * @return a {@code Character} representing {@code c}. + * @return a {@code Character} representing {@code c} * @deprecated Use {@link Character#valueOf(char)}. */ @Deprecated @@ -426,8 +426,8 @@ public static int toIntValue(final char ch, final int defaultValue) { * * @param ch the character to convert, not null * @return the int value of the character - * @throws NullPointerException if the Character is null * @throws IllegalArgumentException if the Character is not ASCII numeric + * @throws NullPointerException if the Character is null */ public static int toIntValue(final Character ch) { return toIntValue(toChar(ch)); diff --git a/src/main/java/org/apache/commons/lang3/Charsets.java b/src/main/java/org/apache/commons/lang3/Charsets.java index 4db73473f20..37dc13c19fd 100644 --- a/src/main/java/org/apache/commons/lang3/Charsets.java +++ b/src/main/java/org/apache/commons/lang3/Charsets.java @@ -37,8 +37,8 @@ final class Charsets { /** * Returns the given {@code charset} or the default Charset if {@code charset} is null. * - * @param charset a Charset or null. - * @return the given {@code charset} or the default Charset if {@code charset} is null. + * @param charset a Charset or null + * @return the given {@code charset} or the default Charset if {@code charset} is null */ static Charset toCharset(final Charset charset) { return charset == null ? Charset.defaultCharset() : charset; @@ -47,9 +47,9 @@ static Charset toCharset(final Charset charset) { /** * Returns the given {@code charset} or the default Charset if {@code charset} is null. * - * @param charsetName a Charset or null. - * @return the given {@code charset} or the default Charset if {@code charset} is null. - * @throws UnsupportedCharsetException If no support for the named charset is available in this instance of the Java + * @param charsetName a Charset or null + * @return the given {@code charset} or the default Charset if {@code charset} is null + * @throws UnsupportedCharsetException if no support for the named charset is available in this instance of the Java * virtual machine */ static Charset toCharset(final String charsetName) { @@ -59,8 +59,8 @@ static Charset toCharset(final String charsetName) { /** * Returns the given {@code charset} or the default Charset if {@code charset} is null. * - * @param charsetName a Charset or null. - * @return the given {@code charset} or the default Charset if {@code charset} is null. + * @param charsetName a Charset or null + * @return the given {@code charset} or the default Charset if {@code charset} is null */ static String toCharsetName(final String charsetName) { return charsetName == null ? Charset.defaultCharset().name() : charsetName; diff --git a/src/main/java/org/apache/commons/lang3/ClassLoaderUtils.java b/src/main/java/org/apache/commons/lang3/ClassLoaderUtils.java index 9e53fef0866..e2ad1a1ea6d 100644 --- a/src/main/java/org/apache/commons/lang3/ClassLoaderUtils.java +++ b/src/main/java/org/apache/commons/lang3/ClassLoaderUtils.java @@ -34,7 +34,7 @@ public class ClassLoaderUtils { /** * Gets the system class loader's URLs, if any. * - * @return the system class loader's URLs, if any. + * @return the system class loader's URLs, if any * @since 3.13.0 */ public static URL[] getSystemURLs() { @@ -44,7 +44,7 @@ public static URL[] getSystemURLs() { /** * Gets the current thread's context class loader's URLs, if any. * - * @return the current thread's context class loader's URLs, if any. + * @return the current thread's context class loader's URLs, if any * @since 3.13.0 */ public static URL[] getThreadURLs() { @@ -58,8 +58,8 @@ private static URL[] getURLs(final ClassLoader cl) { /** * Converts the given class loader to a String calling {@link #toString(URLClassLoader)}. * - * @param classLoader to URLClassLoader to convert. - * @return the formatted string. + * @param classLoader to URLClassLoader to convert + * @return the formatted string */ public static String toString(final ClassLoader classLoader) { if (classLoader instanceof URLClassLoader) { @@ -71,8 +71,8 @@ public static String toString(final ClassLoader classLoader) { /** * Converts the given URLClassLoader to a String in the format {@code "URLClassLoader.toString() + [URL1, URL2, ...]"}. * - * @param classLoader to URLClassLoader to convert. - * @return the formatted string. + * @param classLoader to URLClassLoader to convert + * @return the formatted string */ public static String toString(final URLClassLoader classLoader) { return classLoader != null ? classLoader + Arrays.toString(classLoader.getURLs()) : "null"; diff --git a/src/main/java/org/apache/commons/lang3/ClassPathUtils.java b/src/main/java/org/apache/commons/lang3/ClassPathUtils.java index db7fbf385db..be50f8465ba 100644 --- a/src/main/java/org/apache/commons/lang3/ClassPathUtils.java +++ b/src/main/java/org/apache/commons/lang3/ClassPathUtils.java @@ -33,9 +33,9 @@ public class ClassPathUtils { /** * Converts a package name to a Java path ('/'). * - * @param path the source path. - * @return a package name. - * @throws NullPointerException if {@code path} is null. + * @param path the source path + * @return a package name + * @throws NullPointerException if {@code path} is null * @since 3.13.0 */ public static String packageToPath(final String path) { @@ -45,9 +45,9 @@ public static String packageToPath(final String path) { /** * Converts a Java path ('/') to a package name. * - * @param path the source path. - * @return a package name. - * @throws NullPointerException if {@code path} is null. + * @param path the source path + * @return a package name + * @throws NullPointerException if {@code path} is null * @since 3.13.0 */ public static String pathToPackage(final String path) { @@ -65,10 +65,10 @@ public static String pathToPackage(final String path) { * ClassPathUtils.toFullyQualifiedName(StringUtils.class, "StringUtils.properties") = "org.apache.commons.lang3.StringUtils.properties" * * - * @param context The context for constructing the name. - * @param resourceName the resource name to construct the fully qualified name for. - * @return the fully qualified name of the resource with name {@code resourceName}. - * @throws NullPointerException if either {@code context} or {@code resourceName} is null. + * @param context the context for constructing the name + * @param resourceName the resource name to construct the fully qualified name for + * @return the fully qualified name of the resource with name {@code resourceName} + * @throws NullPointerException if either {@code context} or {@code resourceName} is null */ public static String toFullyQualifiedName(final Class context, final String resourceName) { Objects.requireNonNull(context, "context"); @@ -87,10 +87,10 @@ public static String toFullyQualifiedName(final Class context, final String r * ClassPathUtils.toFullyQualifiedName(StringUtils.class.getPackage(), "StringUtils.properties") = "org.apache.commons.lang3.StringUtils.properties" * * - * @param context The context for constructing the name. - * @param resourceName the resource name to construct the fully qualified name for. - * @return the fully qualified name of the resource with name {@code resourceName}. - * @throws NullPointerException if either {@code context} or {@code resourceName} is null. + * @param context the context for constructing the name + * @param resourceName the resource name to construct the fully qualified name for + * @return the fully qualified name of the resource with name {@code resourceName} + * @throws NullPointerException if either {@code context} or {@code resourceName} is null */ public static String toFullyQualifiedName(final Package context, final String resourceName) { Objects.requireNonNull(context, "context"); @@ -109,10 +109,10 @@ public static String toFullyQualifiedName(final Package context, final String re * ClassPathUtils.toFullyQualifiedPath(StringUtils.class, "StringUtils.properties") = "org/apache/commons/lang3/StringUtils.properties" * * - * @param context The context for constructing the path. - * @param resourceName the resource name to construct the fully qualified path for. - * @return the fully qualified path of the resource with name {@code resourceName}. - * @throws NullPointerException if either {@code context} or {@code resourceName} is null. + * @param context the context for constructing the path + * @param resourceName the resource name to construct the fully qualified path for + * @return the fully qualified path of the resource with name {@code resourceName} + * @throws NullPointerException if either {@code context} or {@code resourceName} is null */ public static String toFullyQualifiedPath(final Class context, final String resourceName) { Objects.requireNonNull(context, "context"); @@ -131,10 +131,10 @@ public static String toFullyQualifiedPath(final Class context, final String r * ClassPathUtils.toFullyQualifiedPath(StringUtils.class.getPackage(), "StringUtils.properties") = "org/apache/commons/lang3/StringUtils.properties" * * - * @param context The context for constructing the path. - * @param resourceName the resource name to construct the fully qualified path for. - * @return the fully qualified path of the resource with name {@code resourceName}. - * @throws NullPointerException if either {@code context} or {@code resourceName} is null. + * @param context the context for constructing the path + * @param resourceName the resource name to construct the fully qualified path for + * @return the fully qualified path of the resource with name {@code resourceName} + * @throws NullPointerException if either {@code context} or {@code resourceName} is null */ public static String toFullyQualifiedPath(final Package context, final String resourceName) { Objects.requireNonNull(context, "context"); diff --git a/src/main/java/org/apache/commons/lang3/ClassUtils.java b/src/main/java/org/apache/commons/lang3/ClassUtils.java index 3032caee6d0..46a33bccf45 100644 --- a/src/main/java/org/apache/commons/lang3/ClassUtils.java +++ b/src/main/java/org/apache/commons/lang3/ClassUtils.java @@ -186,7 +186,7 @@ public enum Interfaces { /** * Gets the class comparator, comparing by class name. * - * @return the class comparator. + * @return the class comparator * @since 3.13.0 */ public static Comparator> comparator() { @@ -200,9 +200,9 @@ public static Comparator> comparator() { * A new {@link List} is returned. {@code null} objects will be copied into the returned list as {@code null}. *

    * - * @param classes the classes to change. - * @return a {@link List} of class names corresponding to the Class objects, {@code null} if null input. - * @throws ClassCastException if {@code classes} contains a non-{@link Class} entry. + * @param classes the classes to change + * @return a {@link List} of class names corresponding to the Class objects, {@code null} if null input + * @throws ClassCastException if {@code classes} contains a non-{@link Class} entry */ public static List convertClassesToClassNames(final List> classes) { return classes == null ? null : classes.stream().map(e -> getName(e, null)).collect(Collectors.toList()); @@ -216,9 +216,9 @@ public static List convertClassesToClassNames(final List> class * class name in the {@link List} is {@code null}, {@code null} is stored in the output {@link List}. *

    * - * @param classNames the classNames to change. - * @return a {@link List} of Class objects corresponding to the class names, {@code null} if null input. - * @throws ClassCastException if classNames contains a non String entry. + * @param classNames the classNames to change + * @return a {@link List} of Class objects corresponding to the class names, {@code null} if null input + * @throws ClassCastException if classNames contains a non String entry */ public static List> convertClassNamesToClasses(final List classNames) { if (classNames == null) { @@ -238,10 +238,10 @@ public static List> convertClassNamesToClasses(final List class /** * Gets the abbreviated name of a {@link Class}. * - * @param cls the class to get the abbreviated name for, may be {@code null}. - * @param lengthHint the desired length of the abbreviated name. - * @return the abbreviated name or an empty string. - * @throws IllegalArgumentException if len <= 0. + * @param cls the class to get the abbreviated name for, may be {@code null} + * @param lengthHint the desired length of the abbreviated name + * @return the abbreviated name or an empty string + * @throws IllegalArgumentException if len <= 0 * @see #getAbbreviatedName(String, int) * @since 3.4 */ @@ -318,11 +318,11 @@ public static String getAbbreviatedName(final Class cls, final int lengthHint * * * - * @param className the className to get the abbreviated name for, may be {@code null}. - * @param lengthHint the desired length of the abbreviated name. + * @param className the className to get the abbreviated name for, may be {@code null} + * @param lengthHint the desired length of the abbreviated name * @return the abbreviated name or an empty string if the specified class name is {@code null} or empty string. The * abbreviated name may be longer than the desired length if it cannot be abbreviated to the desired length. - * @throws IllegalArgumentException if {@code len <= 0}. + * @throws IllegalArgumentException if {@code len <= 0} * @since 3.4 */ public static String getAbbreviatedName(final String className, final int lengthHint) { @@ -367,8 +367,8 @@ public static String getAbbreviatedName(final String className, final int length * maintained. *

    * - * @param cls the class to look up, may be {@code null}. - * @return the {@link List} of interfaces in order, {@code null} if null input. + * @param cls the class to look up, may be {@code null} + * @return the {@link List} of interfaces in order, {@code null} if null input */ public static List> getAllInterfaces(final Class cls) { if (cls == null) { @@ -382,8 +382,8 @@ public static List> getAllInterfaces(final Class cls) { /** * Gets the interfaces for the specified class. * - * @param cls the class to look up, may be {@code null}. - * @param interfacesFound the {@link Set} of interfaces for the class. + * @param cls the class to look up, may be {@code null} + * @param interfacesFound the {@link Set} of interfaces for the class */ private static void getAllInterfaces(Class cls, final Set> interfacesFound) { while (cls != null) { @@ -404,8 +404,8 @@ private static void getAllInterfaces(Class cls, final Set> interface *
  • The last entry is {@link Object}'s class.
  • * * - * @param cls the class to look up, may be {@code null}. - * @return the {@link List} of superclasses in order going up from this one {@code null} if null input. + * @param cls the class to look up, may be {@code null} + * @return the {@link List} of superclasses in order going up from this one {@code null} if null input */ public static List> getAllSuperclasses(final Class cls) { if (cls == null) { @@ -423,10 +423,10 @@ public static List> getAllSuperclasses(final Class cls) { /** * Gets the canonical class name for a {@link Class}. * - * @param cls the class for which to get the canonical class name; may be null. - * @return the canonical name of the class, or the empty String. - * @since 3.7 + * @param cls the class for which to get the canonical class name; may be null + * @return the canonical name of the class, or the empty String * @see Class#getCanonicalName() + * @since 3.7 */ public static String getCanonicalName(final Class cls) { return getCanonicalName(cls, StringUtils.EMPTY); @@ -435,11 +435,11 @@ public static String getCanonicalName(final Class cls) { /** * Gets the canonical name for a {@link Class}. * - * @param cls the class for which to get the canonical class name; may be null. - * @param valueIfNull the return value if null. - * @return the canonical name of the class, or {@code valueIfNull}. - * @since 3.7 + * @param cls the class for which to get the canonical class name; may be null + * @param valueIfNull the return value if null + * @return the canonical name of the class, or {@code valueIfNull} * @see Class#getCanonicalName() + * @since 3.7 */ public static String getCanonicalName(final Class cls, final String valueIfNull) { if (cls == null) { @@ -452,10 +452,10 @@ public static String getCanonicalName(final Class cls, final String valueIfNu /** * Gets the canonical name for an {@link Object}. * - * @param object the object for which to get the canonical class name; may be null. - * @return the canonical name of the object, or the empty String. - * @since 3.7 + * @param object the object for which to get the canonical class name; may be null + * @return the canonical name of the object, or the empty String * @see Class#getCanonicalName() + * @since 3.7 */ public static String getCanonicalName(final Object object) { return getCanonicalName(object, StringUtils.EMPTY); @@ -464,11 +464,11 @@ public static String getCanonicalName(final Object object) { /** * Gets the canonical name for an {@link Object}. * - * @param object the object for which to get the canonical class name; may be null. - * @param valueIfNull the return value if null. - * @return the canonical name of the object or {@code valueIfNull}. - * @since 3.7 + * @param object the object for which to get the canonical class name; may be null + * @param valueIfNull the return value if null + * @return the canonical name of the object or {@code valueIfNull} * @see Class#getCanonicalName() + * @since 3.7 */ public static String getCanonicalName(final Object object, final String valueIfNull) { if (object == null) { @@ -495,9 +495,9 @@ public static String getCanonicalName(final Object object, final String valueIfN * *

    * - * @param name the name of class. - * @return canonical form of class name. - * @throws IllegalArgumentException if the class name is invalid. + * @param name the name of class + * @return canonical form of class name + * @throws IllegalArgumentException if the class name is invalid */ private static String getCanonicalName(final String name) { String className = StringUtils.deleteWhitespace(name); @@ -550,13 +550,13 @@ private static String getCanonicalName(final String name) { * been collapsed. *

    * - * @param classLoader the class loader to use to load the class. - * @param className the class name. - * @return the class represented by {@code className} using the {@code classLoader}. - * @throws NullPointerException if the className is null. - * @throws ClassNotFoundException if the class is not found. - * @throws IllegalArgumentException Thrown if the class name represents an array with more dimensions than the JVM supports, 255. - * @throws IllegalArgumentException Thrown if the class name length is greater than 65,535. + * @param classLoader the class loader to use to load the class + * @param className the class name + * @return the class represented by {@code className} using the {@code classLoader} + * @throws ClassNotFoundException if the class is not found + * @throws IllegalArgumentException thrown if the class name represents an array with more dimensions than the JVM supports, 255 + * @throws IllegalArgumentException thrown if the class name length is greater than 65,535 + * @throws NullPointerException if the className is null * @see Class#forName(String, boolean, ClassLoader) * @see JVM: Array dimension limits in JVM Specification CONSTANT_Class_info * @see JLS: Fully Qualified Names and Canonical Names @@ -575,14 +575,14 @@ public static Class getClass(final ClassLoader classLoader, final String clas * been collapsed. *

    * - * @param classLoader the class loader to use to load the class. - * @param className the class name. - * @param initialize whether the class must be initialized. - * @return the class represented by {@code className} using the {@code classLoader}. - * @throws NullPointerException if the className is null. - * @throws ClassNotFoundException if the class is not found. - * @throws IllegalArgumentException Thrown if the class name represents an array with more dimensions than the JVM supports, 255. - * @throws IllegalArgumentException Thrown if the class name length is greater than 65,535. + * @param classLoader the class loader to use to load the class + * @param className the class name + * @param initialize whether the class must be initialized + * @return the class represented by {@code className} using the {@code classLoader} + * @throws ClassNotFoundException if the class is not found + * @throws IllegalArgumentException thrown if the class name represents an array with more dimensions than the JVM supports, 255 + * @throws IllegalArgumentException thrown if the class name length is greater than 65,535 + * @throws NullPointerException if the className is null * @see Class#forName(String, boolean, ClassLoader) * @see JVM: Array dimension limits in JVM Specification CONSTANT_Class_info * @see JLS: Fully Qualified Names and Canonical Names @@ -617,10 +617,10 @@ public static Class getClass(final ClassLoader classLoader, final String clas * * @param className the class name * @return the class represented by {@code className} using the current thread's context class loader - * @throws NullPointerException if the className is null * @throws ClassNotFoundException if the class is not found - * @throws IllegalArgumentException Thrown if the class name represents an array with more dimensions than the JVM supports, 255. - * @throws IllegalArgumentException Thrown if the class name length is greater than 65,535. + * @throws IllegalArgumentException thrown if the class name represents an array with more dimensions than the JVM supports, 255 + * @throws IllegalArgumentException thrown if the class name length is greater than 65,535 + * @throws NullPointerException if the className is null * @see Class#forName(String, boolean, ClassLoader) * @see JVM: Array dimension limits in JVM Specification CONSTANT_Class_info * @see JLS: Fully Qualified Names and Canonical Names @@ -639,13 +639,13 @@ public static Class getClass(final String className) throws ClassNotFoundExce * been collapsed. *

    * - * @param className the class name. - * @param initialize whether the class must be initialized. - * @return the class represented by {@code className} using the current thread's context class loader. - * @throws NullPointerException if the className is null. - * @throws ClassNotFoundException if the class is not found. - * @throws IllegalArgumentException Thrown if the class name represents an array with more dimensions than the JVM supports, 255. - * @throws IllegalArgumentException Thrown if the class name length is greater than 65,535. + * @param className the class name + * @param initialize whether the class must be initialized + * @return the class represented by {@code className} using the current thread's context class loader + * @throws ClassNotFoundException if the class is not found + * @throws IllegalArgumentException thrown if the class name represents an array with more dimensions than the JVM supports, 255 + * @throws IllegalArgumentException thrown if the class name length is greater than 65,535 + * @throws NullPointerException if the className is null * @see Class#forName(String, boolean, ClassLoader) * @see JVM: Array dimension limits in JVM Specification CONSTANT_Class_info * @see JLS: Fully Qualified Names and Canonical Names @@ -660,9 +660,9 @@ public static Class getClass(final String className, final boolean initialize /** * Delegates to {@link Class#getComponentType()} using generics. * - * @param The array class type. - * @param cls A class or null. - * @return The array component type or null. + * @param the array class type + * @param cls a class or null + * @return the array component type or null * @see Class#getComponentType() * @since 3.13.0 */ @@ -674,10 +674,10 @@ public static Class getComponentType(final Class cls) { /** * Null-safe version of {@code cls.getName()} * - * @param cls the class for which to get the class name; may be null. - * @return the class name or the empty string in case the argument is {@code null}. - * @since 3.7 + * @param cls the class for which to get the class name; may be null + * @return the class name or the empty string in case the argument is {@code null} * @see Class#getSimpleName() + * @since 3.7 */ public static String getName(final Class cls) { return getName(cls, StringUtils.EMPTY); @@ -686,11 +686,11 @@ public static String getName(final Class cls) { /** * Null-safe version of {@code cls.getName()} * - * @param cls the class for which to get the class name; may be null. - * @param valueIfNull the return value if the argument {@code cls} is {@code null}. + * @param cls the class for which to get the class name; may be null + * @param valueIfNull the return value if the argument {@code cls} is {@code null} * @return the class name or {@code valueIfNull} - * @since 3.7 * @see Class#getName() + * @since 3.7 */ public static String getName(final Class cls, final String valueIfNull) { return getName(cls, valueIfNull, false); @@ -703,10 +703,10 @@ static String getName(final Class cls, final String valueIfNull, final boolea /** * Null-safe version of {@code object.getClass().getName()} * - * @param object the object for which to get the class name; may be null. - * @return the class name or the empty String. - * @since 3.7 + * @param object the object for which to get the class name; may be null + * @return the class name or the empty String * @see Class#getSimpleName() + * @since 3.7 */ public static String getName(final Object object) { return getName(object, StringUtils.EMPTY); @@ -715,11 +715,11 @@ public static String getName(final Object object) { /** * Null-safe version of {@code object.getClass().getSimpleName()} * - * @param object the object for which to get the class name; may be null. - * @param valueIfNull the value to return if {@code object} is {@code null}. - * @return the class name or {@code valueIfNull}. - * @since 3.0 + * @param object the object for which to get the class name; may be null + * @param valueIfNull the value to return if {@code object} is {@code null} + * @return the class name or {@code valueIfNull} * @see Class#getName() + * @since 3.0 */ public static String getName(final Object object, final String valueIfNull) { return object == null ? valueIfNull : object.getClass().getName(); @@ -728,8 +728,8 @@ public static String getName(final Object object, final String valueIfNull) { /** * Gets the package name from the canonical name of a {@link Class}. * - * @param cls the class to get the package name for, may be {@code null}. - * @return the package name or an empty string. + * @param cls the class to get the package name for, may be {@code null} + * @return the package name or an empty string * @since 2.4 */ public static String getPackageCanonicalName(final Class cls) { @@ -742,9 +742,9 @@ public static String getPackageCanonicalName(final Class cls) { /** * Gets the package name from the class name of an {@link Object}. * - * @param object the class to get the package name for, may be null. - * @param valueIfNull the value to return if null. - * @return the package name of the object, or the null value. + * @param object the class to get the package name for, may be null + * @param valueIfNull the value to return if null + * @return the package name of the object, or the null value * @since 2.4 */ public static String getPackageCanonicalName(final Object object, final String valueIfNull) { @@ -764,8 +764,8 @@ public static String getPackageCanonicalName(final Object object, final String v * If the class is in the default package, return an empty string. *

    * - * @param name the name to get the package name for, may be {@code null}. - * @return the package name or an empty string. + * @param name the name to get the package name for, may be {@code null} + * @return the package name or an empty string * @since 2.4 */ public static String getPackageCanonicalName(final String name) { @@ -775,7 +775,7 @@ public static String getPackageCanonicalName(final String name) { /** * Gets the package name of a {@link Class}. * - * @param cls the class to get the package name for, may be {@code null}. + * @param cls the class to get the package name for, may be {@code null} * @return the package name or an empty string */ public static String getPackageName(final Class cls) { @@ -788,9 +788,9 @@ public static String getPackageName(final Class cls) { /** * Gets the package name of an {@link Object}. * - * @param object the class to get the package name for, may be null. - * @param valueIfNull the value to return if null. - * @return the package name of the object, or the null value. + * @param object the class to get the package name for, may be null + * @param valueIfNull the value to return if null + * @return the package name of the object, or the null value */ public static String getPackageName(final Object object, final String valueIfNull) { if (object == null) { @@ -809,8 +809,8 @@ public static String getPackageName(final Object object, final String valueIfNul * If the class is unpackaged, return an empty string. *

    * - * @param className the className to get the package name for, may be {@code null}. - * @return the package name or an empty string. + * @param className the className to get the package name for, may be {@code null} + * @return the package name or an empty string */ public static String getPackageName(String className) { if (StringUtils.isEmpty(className)) { @@ -836,8 +836,8 @@ public static String getPackageName(String className) { /** * Gets the primitive class for the given class name, for example "byte". * - * @param className the primitive class for the given class name. - * @return the primitive class. + * @param className the primitive class for the given class name + * @return the primitive class */ static Class getPrimitiveClass(final String className) { return NAME_PRIMITIVE_MAP.get(className); @@ -854,14 +854,14 @@ static Class getPrimitiveClass(final String className) { * Object result = method.invoke(set, new Object[]);} * * - * @param cls the class to check, not null. - * @param methodName the name of the method. - * @param parameterTypes the list of parameters. - * @return the method. - * @throws NullPointerException if the class is null. - * @throws SecurityException if a security violation occurred. + * @param cls the class to check, not null + * @param methodName the name of the method + * @param parameterTypes the list of parameters + * @return the method * @throws NoSuchMethodException if the method is not found in the given class or if the method doesn't conform with the - * requirements. + * requirements + * @throws NullPointerException if the class is null + * @throws SecurityException if a security violation occurred */ public static Method getPublicMethod(final Class cls, final String methodName, final Class... parameterTypes) throws NoSuchMethodException { final Method declaredMethod = cls.getMethod(methodName, parameterTypes); @@ -890,10 +890,10 @@ public static Method getPublicMethod(final Class cls, final String methodName /** * Gets the canonical name minus the package name from a {@link Class}. * - * @param cls the class for which to get the short canonical class name; may be null. - * @return the canonical name without the package name or an empty string. - * @since 2.4 + * @param cls the class for which to get the short canonical class name; may be null + * @return the canonical name without the package name or an empty string * @see Class#getCanonicalName() + * @since 2.4 */ public static String getShortCanonicalName(final Class cls) { return cls == null ? StringUtils.EMPTY : getShortCanonicalName(cls.getCanonicalName()); @@ -902,11 +902,11 @@ public static String getShortCanonicalName(final Class cls) { /** * Gets the canonical name minus the package name for an {@link Object}. * - * @param object the class to get the short name for, may be null. - * @param valueIfNull the value to return if null. - * @return the canonical name of the object without the package name, or the null value. - * @since 2.4 + * @param object the class to get the short name for, may be null + * @param valueIfNull the value to return if null + * @return the canonical name of the object without the package name, or the null value * @see Class#getCanonicalName() + * @since 2.4 */ public static String getShortCanonicalName(final Object object, final String valueIfNull) { return object == null ? valueIfNull : getShortCanonicalName(object.getClass()); @@ -1002,8 +1002,8 @@ public static String getShortCanonicalName(final Object object, final String val * * * - * @param canonicalName the class name to get the short name for. - * @return the canonical name of the class without the package name or an empty string. + * @param canonicalName the class name to get the short name for + * @return the canonical name of the class without the package name or an empty string * @since 2.4 */ public static String getShortCanonicalName(final String canonicalName) { @@ -1013,7 +1013,7 @@ public static String getShortCanonicalName(final String canonicalName) { /** * Gets the class name minus the package name from a {@link Class}. * - * @param cls the class to get the short name for. + * @param cls the class to get the short name for * @return the class name without the package name or an empty string. If the class is an inner class then the returned * value will contain the outer class or classes separated with {@code .} (dot) character. */ @@ -1046,10 +1046,10 @@ public static String getShortClassName(final Class cls) { /** * Gets the class name of the {@code object} without the package name or names. * - * @param object the class to get the short name for, may be {@code null}. - * @param valueIfNull the value to return if the object is {@code null}. + * @param object the class to get the short name for, may be {@code null} + * @param valueIfNull the value to return if the object is {@code null} * @return the class name of the object without the package name, or {@code valueIfNull} if the argument {@code object} - * is {@code null}. + * is {@code null} */ public static String getShortClassName(final Object object, final String valueIfNull) { if (object == null) { @@ -1120,10 +1120,10 @@ public static String getShortClassName(String className) { /** * Null-safe version of {@code cls.getSimpleName()} * - * @param cls the class for which to get the simple name; may be null. - * @return the simple class name or the empty string in case the argument is {@code null}. - * @since 3.0 + * @param cls the class for which to get the simple name; may be null + * @return the simple class name or the empty string in case the argument is {@code null} * @see Class#getSimpleName() + * @since 3.0 */ public static String getSimpleName(final Class cls) { return getSimpleName(cls, StringUtils.EMPTY); @@ -1132,11 +1132,11 @@ public static String getSimpleName(final Class cls) { /** * Null-safe version of {@code cls.getSimpleName()} * - * @param cls the class for which to get the simple name; may be null. - * @param valueIfNull the value to return if null. - * @return the simple class name or {@code valueIfNull} if the argument {@code cls} is {@code null}. - * @since 3.0 + * @param cls the class for which to get the simple name; may be null + * @param valueIfNull the value to return if null + * @return the simple class name or {@code valueIfNull} if the argument {@code cls} is {@code null} * @see Class#getSimpleName() + * @since 3.0 */ public static String getSimpleName(final Class cls, final String valueIfNull) { return cls == null ? valueIfNull : cls.getSimpleName(); @@ -1153,10 +1153,10 @@ public static String getSimpleName(final Class cls, final String valueIfNull) * in that case. *

    * - * @param object the object for which to get the simple class name; may be null. - * @return the simple class name or the empty string in case the argument is {@code null}. - * @since 3.7 + * @param object the object for which to get the simple class name; may be null + * @return the simple class name or the empty string in case the argument is {@code null} * @see Class#getSimpleName() + * @since 3.7 */ public static String getSimpleName(final Object object) { return getSimpleName(object, StringUtils.EMPTY); @@ -1165,11 +1165,11 @@ public static String getSimpleName(final Object object) { /** * Null-safe version of {@code object.getClass().getSimpleName()} * - * @param object the object for which to get the simple class name; may be null. - * @param valueIfNull the value to return if {@code object} is {@code null}. - * @return the simple class name or {@code valueIfNull} if the argument {@code object} is {@code null}. - * @since 3.0 + * @param object the object for which to get the simple class name; may be null + * @param valueIfNull the value to return if {@code object} is {@code null} + * @return the simple class name or {@code valueIfNull} if the argument {@code object} is {@code null} * @see Class#getSimpleName() + * @since 3.0 */ public static String getSimpleName(final Object object, final String valueIfNull) { return object == null ? valueIfNull : object.getClass().getSimpleName(); @@ -1179,8 +1179,8 @@ public static String getSimpleName(final Object object, final String valueIfNull * Gets an {@link Iterable} that can iterate over a class hierarchy in ascending (subclass to superclass) order, * excluding interfaces. * - * @param type the type to get the class hierarchy from. - * @return Iterable an Iterable over the class hierarchy of the given class. + * @param type the type to get the class hierarchy from + * @return iterable an Iterable over the class hierarchy of the given class * @since 3.2 */ public static Iterable> hierarchy(final Class type) { @@ -1190,9 +1190,9 @@ public static Iterable> hierarchy(final Class type) { /** * Gets an {@link Iterable} that can iterate over a class hierarchy in ascending (subclass to superclass) order. * - * @param type the type to get the class hierarchy from. - * @param interfacesBehavior switch indicating whether to include or exclude interfaces. - * @return Iterable an Iterable over the class hierarchy of the given class. + * @param type the type to get the class hierarchy from + * @param interfacesBehavior switch indicating whether to include or exclude interfaces + * @return iterable an Iterable over the class hierarchy of the given class * @since 3.2 */ public static Iterable> hierarchy(final Class type, final Interfaces interfacesBehavior) { @@ -1295,9 +1295,9 @@ private void walkInterfaces(final Set> addTo, final Class c) { * VMs running Java versions > 1.5. *

    * - * @param cls the Class to check, may be null. - * @param toClass the Class to try to assign into, returns false if null. - * @return {@code true} if assignment possible. + * @param cls the Class to check, may be null + * @param toClass the Class to try to assign into, returns false if null + * @return {@code true} if assignment possible */ public static boolean isAssignable(final Class cls, final Class toClass) { return isAssignable(cls, toClass, true); @@ -1328,10 +1328,10 @@ public static boolean isAssignable(final Class cls, final Class toClass) { * Specification, sections 5.1.1, 5.1.2 and 5.1.4 for details. *

    * - * @param cls the Class to check, may be null. - * @param toClass the Class to try to assign into, returns false if null. - * @param autoboxing whether to use implicit autoboxing/unboxing between primitives and wrappers. - * @return {@code true} if assignment possible. + * @param cls the Class to check, may be null + * @param toClass the Class to try to assign into, returns false if null + * @param autoboxing whether to use implicit autoboxing/unboxing between primitives and wrappers + * @return {@code true} if assignment possible */ public static boolean isAssignable(Class cls, final Class toClass, final boolean autoboxing) { if (toClass == null) { @@ -1428,9 +1428,9 @@ public static boolean isAssignable(Class cls, final Class toClass, final b * VMs running Java versions > 1.5. *

    * - * @param classArray the array of Classes to check, may be {@code null}. - * @param toClassArray the array of Classes to try to assign into, may be {@code null}. - * @return {@code true} if assignment possible. + * @param classArray the array of Classes to check, may be {@code null} + * @param toClassArray the array of Classes to try to assign into, may be {@code null} + * @return {@code true} if assignment possible */ public static boolean isAssignable(final Class[] classArray, final Class... toClassArray) { return isAssignable(classArray, toClassArray, true); @@ -1489,8 +1489,8 @@ public static boolean isAssignable(Class[] classArray, Class[] toClassArra /** * Tests whether the specified class an inner class or static nested class. * - * @param cls the class to check, may be null. - * @return {@code true} if the class is an inner or static nested class, false if not or {@code null}. + * @param cls the class to check, may be null + * @return {@code true} if the class is an inner or static nested class, false if not or {@code null} */ public static boolean isInnerClass(final Class cls) { return cls != null && cls.getEnclosingClass() != null; @@ -1500,9 +1500,9 @@ public static boolean isInnerClass(final Class cls) { * Tests whether the given {@code type} is a primitive or primitive wrapper ({@link Boolean}, {@link Byte}, * {@link Character}, {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * - * @param type The class to query or null. + * @param type the class to query or null * @return true if the given {@code type} is a primitive or primitive wrapper ({@link Boolean}, {@link Byte}, - * {@link Character}, {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). + * {@link Character}, {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}) * @since 3.1 */ public static boolean isPrimitiveOrWrapper(final Class type) { @@ -1513,9 +1513,9 @@ public static boolean isPrimitiveOrWrapper(final Class type) { * Tests whether the given {@code type} is a primitive wrapper ({@link Boolean}, {@link Byte}, {@link Character}, * {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * - * @param type The class to query or null. + * @param type the class to query or null * @return true if the given {@code type} is a primitive wrapper ({@link Boolean}, {@link Byte}, {@link Character}, - * {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). + * {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}) * @since 3.1 */ public static boolean isPrimitiveWrapper(final Class type) { @@ -1525,8 +1525,8 @@ public static boolean isPrimitiveWrapper(final Class type) { /** * Tests whether a {@link Class} is public. * - * @param cls Class to test. - * @return {@code true} if {@code cls} is public. + * @param cls class to test + * @return {@code true} if {@code cls} is public * @since 3.13.0 */ public static boolean isPublic(final Class cls) { @@ -1536,7 +1536,7 @@ public static boolean isPublic(final Class cls) { /** * Converts the specified array of primitive Class objects to an array of its corresponding wrapper Class objects. * - * @param classes the class array to convert, may be null or empty. + * @param classes the class array to convert, may be null or empty * @return an array which contains for each given class, the wrapper class or the original class if class is not a primitive. {@code null} if null input. * Empty array if an empty array passed in. * @since 2.1 @@ -1558,7 +1558,7 @@ public static Class[] primitivesToWrappers(final Class... classes) { * NOTE: From v2.2, this method handles {@code Void.TYPE}, returning {@code Void.TYPE}. *

    * - * @param cls the class to convert, may be null. + * @param cls the class to convert, may be null * @return the wrapper class for {@code cls} or {@code cls} if {@code cls} is not a primitive. {@code null} if null input. * @since 2.1 */ @@ -1574,8 +1574,8 @@ public static Class primitiveToWrapper(final Class cls) { * This method returns {@code null} for a {@code null} input array. *

    * - * @param array an {@link Object} array. - * @return a {@link Class} array, {@code null} if null array input. + * @param array an {@link Object} array + * @return a {@link Class} array, {@code null} if null array input * @since 2.4 */ public static Class[] toClass(final Object... array) { @@ -1595,11 +1595,11 @@ public static Class[] toClass(final Object... array) { * been collapsed. *

    * - * @param className the class name. - * @return the converted name. - * @throws NullPointerException if the className is null. - * @throws IllegalArgumentException Thrown if the class name represents an array with more dimensions than the JVM supports, 255. - * @throws IllegalArgumentException Thrown if the class name length is greater than 65,535. + * @param className the class name + * @return the converted name + * @throws IllegalArgumentException thrown if the class name represents an array with more dimensions than the JVM supports, 255 + * @throws IllegalArgumentException thrown if the class name length is greater than 65,535 + * @throws NullPointerException if the className is null * @see JVM: Array dimension limits in JVM Specification * CONSTANT_Class_info * @see JLS: Fully Qualified Names and Canonical Names @@ -1666,12 +1666,12 @@ private static String toCleanName(final String className) { *

    * * @param runAheadTarget the target index (where the characters were copied to) pointing after the last character copied - * when the current part was copied. + * when the current part was copied * @param source the source index (where the characters were copied from) pointing after the last character copied when - * the current part was copied. - * @param originalLength the original length of the class full name, which is abbreviated. - * @param desiredLength the desired length of the abbreviated class name. - * @return {@code true} if it can be kept in its original length; {@code false} if the current part has to be abbreviated. + * the current part was copied + * @param originalLength the original length of the class full name, which is abbreviated + * @param desiredLength the desired length of the abbreviated class name + * @return {@code true} if it can be kept in its original length; {@code false} if the current part has to be abbreviated */ private static boolean useFull(final int runAheadTarget, final int source, final int originalLength, final int desiredLength) { return source >= originalLength || runAheadTarget + originalLength - source <= desiredLength; @@ -1684,7 +1684,7 @@ private static boolean useFull(final int runAheadTarget, final int source, final * This method invokes {@code wrapperToPrimitive()} for each element of the passed in array. *

    * - * @param classes the class array to convert, may be null or empty. + * @param classes the class array to convert, may be null or empty * @return an array which contains for each given class, the primitive class or null if the original class is not a wrapper class. * {@code null} if null input. Empty array if an empty array passed in. * @see #wrapperToPrimitive(Class) @@ -1709,8 +1709,8 @@ public static Class[] wrappersToPrimitives(final Class... classes) { * classes, or if the parameter is null, the return value is null. *

    * - * @param cls the class to convert, may be null. - * @return the corresponding primitive type if {@code cls} is a wrapper class, null otherwise. + * @param cls the class to convert, may be null + * @return the corresponding primitive type if {@code cls} is a wrapper class, null otherwise * @see #primitiveToWrapper(Class) * @since 2.4 */ diff --git a/src/main/java/org/apache/commons/lang3/Conversion.java b/src/main/java/org/apache/commons/lang3/Conversion.java index 2b858a05997..4237c714d72 100644 --- a/src/main/java/org/apache/commons/lang3/Conversion.java +++ b/src/main/java/org/apache/commons/lang3/Conversion.java @@ -85,10 +85,10 @@ public class Conversion { * (1, 0, 0, 0) is converted as follow: '8' (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0) is converted to '4'. *

    * - * @param src the binary to convert. - * @return a hexadecimal digit representing the selected bits. - * @throws IllegalArgumentException if {@code src} is empty. - * @throws NullPointerException if {@code src} is {@code null}. + * @param src the binary to convert + * @return a hexadecimal digit representing the selected bits + * @throws IllegalArgumentException if {@code src} is empty + * @throws NullPointerException if {@code src} is {@code null} */ public static char binaryBeMsb0ToHexDigit(final boolean[] src) { return binaryBeMsb0ToHexDigit(src, 0); @@ -101,12 +101,12 @@ public static char binaryBeMsb0ToHexDigit(final boolean[] src) { * (1, 0, 0, 0) with srcPos = 0 is converted as follow: '8' (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0) with srcPos = 2 is converted to '5'. *

    * - * @param src the binary to convert. - * @param srcPos the position of the LSB to start the conversion. - * @return a hexadecimal digit representing the selected bits. - * @throws IllegalArgumentException if {@code src} is empty. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IndexOutOfBoundsException if {@code srcPos} is outside the array. + * @param src the binary to convert + * @param srcPos the position of the LSB to start the conversion + * @return a hexadecimal digit representing the selected bits + * @throws IllegalArgumentException if {@code src} is empty + * @throws IndexOutOfBoundsException if {@code srcPos} is outside the array + * @throws NullPointerException if {@code src} is {@code null} */ public static char binaryBeMsb0ToHexDigit(final boolean[] src, final int srcPos) { // JDK 9: Objects.checkIndex(int index, int length) @@ -146,15 +146,15 @@ public static char binaryBeMsb0ToHexDigit(final boolean[] src, final int srcPos) /** * Converts binary (represented as boolean array) into a byte using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the binary to convert. - * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion. - * @param dstInit initial value of the destination byte. - * @param dstPos the position of the LSB, in bits, in the result byte. - * @param nBools the number of booleans to convert. - * @return a byte containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 8}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length}. + * @param src the binary to convert + * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion + * @param dstInit initial value of the destination byte + * @param dstPos the position of the LSB, in bits, in the result byte + * @param nBools the number of booleans to convert + * @return a byte containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length} + * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 8} + * @throws NullPointerException if {@code src} is {@code null} */ public static byte binaryToByte(final boolean[] src, final int srcPos, final byte dstInit, final int dstPos, final int nBools) { if (src.length == 0 && srcPos == 0 || 0 == nBools) { @@ -180,10 +180,10 @@ public static byte binaryToByte(final boolean[] src, final int srcPos, final byt * (1, 0, 0, 0) is converted as follow: '1'. *

    * - * @param src the binary to convert. - * @return a hexadecimal digit representing the selected bits. - * @throws IllegalArgumentException if {@code src} is empty. - * @throws NullPointerException if {@code src} is {@code null}. + * @param src the binary to convert + * @return a hexadecimal digit representing the selected bits + * @throws IllegalArgumentException if {@code src} is empty + * @throws NullPointerException if {@code src} is {@code null} */ public static char binaryToHexDigit(final boolean[] src) { return binaryToHexDigit(src, 0); @@ -196,11 +196,11 @@ public static char binaryToHexDigit(final boolean[] src) { * (1, 0, 0, 0) is converted as follow: '1'. *

    * - * @param src the binary to convert. - * @param srcPos the position of the LSB to start the conversion. - * @return a hexadecimal digit representing the selected bits. - * @throws IllegalArgumentException if {@code src} is empty. - * @throws NullPointerException if {@code src} is {@code null}. + * @param src the binary to convert + * @param srcPos the position of the LSB to start the conversion + * @return a hexadecimal digit representing the selected bits + * @throws IllegalArgumentException if {@code src} is empty + * @throws NullPointerException if {@code src} is {@code null} */ public static char binaryToHexDigit(final boolean[] src, final int srcPos) { if (src.length == 0) { @@ -237,10 +237,10 @@ public static char binaryToHexDigit(final boolean[] src, final int srcPos) { * (1, 0, 0, 0) is converted as follow: '8'. *

    * - * @param src the binary to convert. - * @return a hexadecimal digit representing the selected bits. - * @throws IllegalArgumentException if {@code src} is empty, {@code src.length < 4} or {@code src.length > 8}. - * @throws NullPointerException if {@code src} is {@code null}. + * @param src the binary to convert + * @return a hexadecimal digit representing the selected bits + * @throws IllegalArgumentException if {@code src} is empty, {@code src.length < 4} or {@code src.length > 8} + * @throws NullPointerException if {@code src} is {@code null} */ public static char binaryToHexDigitMsb0_4bits(final boolean[] src) { return binaryToHexDigitMsb0_4bits(src, 0); @@ -253,11 +253,11 @@ public static char binaryToHexDigitMsb0_4bits(final boolean[] src) { * (1, 0, 0, 0) is converted as follow: '8' (1, 0, 0, 1, 1, 0, 1, 0) with srcPos = 3 is converted to 'D' *

    * - * @param src the binary to convert. - * @param srcPos the position of the LSB to start the conversion. - * @return a hexadecimal digit representing the selected bits. - * @throws IllegalArgumentException if {@code src} is empty, {@code src.length > 8} or {@code src.length - srcPos < 4}. - * @throws NullPointerException if {@code src} is {@code null}. + * @param src the binary to convert + * @param srcPos the position of the LSB to start the conversion + * @return a hexadecimal digit representing the selected bits + * @throws IllegalArgumentException if {@code src} is empty, {@code src.length > 8} or {@code src.length - srcPos < 4} + * @throws NullPointerException if {@code src} is {@code null} */ public static char binaryToHexDigitMsb0_4bits(final boolean[] src, final int srcPos) { if (src.length > Byte.SIZE) { @@ -293,15 +293,15 @@ public static char binaryToHexDigitMsb0_4bits(final boolean[] src, final int src /** * Converts binary (represented as boolean array) into an int using the default (little endian, LSB0) byte and bit ordering. * - * @param src the binary to convert. - * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion. - * @param dstInit initial value of the destination int. - * @param dstPos the position of the LSB, in bits, in the result int. - * @param nBools the number of booleans to convert. - * @return an int containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 32}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length}. + * @param src the binary to convert + * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion + * @param dstInit initial value of the destination int + * @param dstPos the position of the LSB, in bits, in the result int + * @param nBools the number of booleans to convert + * @return an int containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length} + * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 32} + * @throws NullPointerException if {@code src} is {@code null} */ public static int binaryToInt(final boolean[] src, final int srcPos, final int dstInit, final int dstPos, final int nBools) { if (src.length == 0 && srcPos == 0 || 0 == nBools) { @@ -323,15 +323,15 @@ public static int binaryToInt(final boolean[] src, final int srcPos, final int d /** * Converts binary (represented as boolean array) into a long using the default (little endian, LSB0) byte and bit ordering. * - * @param src the binary to convert. - * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion. - * @param dstInit initial value of the destination long. - * @param dstPos the position of the LSB, in bits, in the result long. - * @param nBools the number of booleans to convert. - * @return a long containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length}. + * @param src the binary to convert + * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion + * @param dstInit initial value of the destination long + * @param dstPos the position of the LSB, in bits, in the result long + * @param nBools the number of booleans to convert + * @return a long containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length} + * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 64} + * @throws NullPointerException if {@code src} is {@code null} */ public static long binaryToLong(final boolean[] src, final int srcPos, final long dstInit, final int dstPos, final int nBools) { if (src.length == 0 && srcPos == 0 || 0 == nBools) { @@ -353,15 +353,15 @@ public static long binaryToLong(final boolean[] src, final int srcPos, final lon /** * Converts binary (represented as boolean array) into a short using the default (little endian, LSB0) byte and bit ordering. * - * @param src the binary to convert. - * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion. - * @param dstInit initial value of the destination short. - * @param dstPos the position of the LSB, in bits, in the result short. - * @param nBools the number of booleans to convert. - * @return a short containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 16}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length}. + * @param src the binary to convert + * @param srcPos the position in {@code src}, in boolean unit, from where to start the conversion + * @param dstInit initial value of the destination short + * @param dstPos the position of the LSB, in bits, in the result short + * @param nBools the number of booleans to convert + * @return a short containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBools > src.length} + * @throws IllegalArgumentException if {@code nBools - 1 + dstPos >= 16} + * @throws NullPointerException if {@code src} is {@code null} */ public static short binaryToShort(final boolean[] src, final int srcPos, final short dstInit, final int dstPos, final int nBools) { if (src.length == 0 && srcPos == 0 || 0 == nBools) { @@ -383,15 +383,15 @@ public static short binaryToShort(final boolean[] src, final int srcPos, final s /** * Converts an array of byte into an int using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the byte array to convert. - * @param srcPos the position in {@code src}, in byte unit, from where to start the conversion. - * @param dstInit initial value of the destination int. - * @param dstPos the position of the LSB, in bits, in the result int. - * @param nBytes the number of bytes to convert. - * @return an int containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + dstPos >= 32}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBytes > src.length}. + * @param src the byte array to convert + * @param srcPos the position in {@code src}, in byte unit, from where to start the conversion + * @param dstInit initial value of the destination int + * @param dstPos the position of the LSB, in bits, in the result int + * @param nBytes the number of bytes to convert + * @return an int containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBytes > src.length} + * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + dstPos >= 32} + * @throws NullPointerException if {@code src} is {@code null} */ public static int byteArrayToInt(final byte[] src, final int srcPos, final int dstInit, final int dstPos, final int nBytes) { if (src.length == 0 && srcPos == 0 || 0 == nBytes) { @@ -413,15 +413,15 @@ public static int byteArrayToInt(final byte[] src, final int srcPos, final int d /** * Converts an array of byte into a long using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the byte array to convert. - * @param srcPos the position in {@code src}, in byte unit, from where to start the conversion. - * @param dstInit initial value of the destination long. - * @param dstPos the position of the LSB, in bits, in the result long. - * @param nBytes the number of bytes to convert. - * @return a long containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + dstPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBytes > src.length}. + * @param src the byte array to convert + * @param srcPos the position in {@code src}, in byte unit, from where to start the conversion + * @param dstInit initial value of the destination long + * @param dstPos the position of the LSB, in bits, in the result long + * @param nBytes the number of bytes to convert + * @return a long containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBytes > src.length} + * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + dstPos >= 64} + * @throws NullPointerException if {@code src} is {@code null} */ public static long byteArrayToLong(final byte[] src, final int srcPos, final long dstInit, final int dstPos, final int nBytes) { if (src.length == 0 && srcPos == 0 || 0 == nBytes) { @@ -443,15 +443,15 @@ public static long byteArrayToLong(final byte[] src, final int srcPos, final lon /** * Converts an array of byte into a short using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the byte array to convert. - * @param srcPos the position in {@code src}, in byte unit, from where to start the conversion. - * @param dstInit initial value of the destination short. - * @param dstPos the position of the LSB, in bits, in the result short. - * @param nBytes the number of bytes to convert. - * @return a short containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + dstPos >= 16}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBytes > src.length}. + * @param src the byte array to convert + * @param srcPos the position in {@code src}, in byte unit, from where to start the conversion + * @param dstInit initial value of the destination short + * @param dstPos the position of the LSB, in bits, in the result short + * @param nBytes the number of bytes to convert + * @return a short containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nBytes > src.length} + * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + dstPos >= 16} + * @throws NullPointerException if {@code src} is {@code null} */ public static short byteArrayToShort(final byte[] src, final int srcPos, final short dstInit, final int dstPos, final int nBytes) { if (src.length == 0 && srcPos == 0 || 0 == nBytes) { @@ -473,11 +473,11 @@ public static short byteArrayToShort(final byte[] src, final int srcPos, final s /** * Converts bytes from an array into a UUID using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the byte array to convert. - * @param srcPos the position in {@code src} where to copy the result from. - * @return a UUID. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if array does not contain at least 16 bytes beginning with {@code srcPos}. + * @param src the byte array to convert + * @param srcPos the position in {@code src} where to copy the result from + * @return a UUID + * @throws IllegalArgumentException if array does not contain at least 16 bytes beginning with {@code srcPos} + * @throws NullPointerException if {@code src} is {@code null} */ public static UUID byteArrayToUuid(final byte[] src, final int srcPos) { if (src.length - srcPos < 16) { @@ -489,15 +489,15 @@ public static UUID byteArrayToUuid(final byte[] src, final int srcPos) { /** * Converts a byte into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the byte to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 8}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length}. + * @param src the byte to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length} + * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 8} + * @throws NullPointerException if {@code dst} is {@code null} */ public static boolean[] byteToBinary(final byte src, final int srcPos, final boolean[] dst, final int dstPos, final int nBools) { if (0 == nBools) { @@ -516,14 +516,14 @@ public static boolean[] byteToBinary(final byte src, final int srcPos, final boo /** * Converts a byte into an array of char using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the byte to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dstInit the initial value for the result String. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 8}. - * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos}. + * @param src the byte to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dstInit the initial value for the result String + * @param dstPos the position in {@code dst} where to copy the result + * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 8} + * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos} */ public static String byteToHex(final byte src, final int srcPos, final String dstInit, final int dstPos, final int nHexs) { if (0 == nHexs) { @@ -554,9 +554,9 @@ public static String byteToHex(final byte src, final int srcPos, final String ds * '1' is converted as follow: (0, 0, 0, 1). *

    * - * @param hexChar the hexadecimal digit to convert. - * @return a boolean array with the binary representation of {@code hexDigit}. - * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit. + * @param hexChar the hexadecimal digit to convert + * @return a boolean array with the binary representation of {@code hexDigit} + * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit */ public static boolean[] hexDigitMsb0ToBinary(final char hexChar) { switch (hexChar) { @@ -610,9 +610,9 @@ public static boolean[] hexDigitMsb0ToBinary(final char hexChar) { * '1' is converted to 8. *

    * - * @param hexChar the hexadecimal digit to convert. - * @return an int equals to {@code hexDigit}. - * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit. + * @param hexChar the hexadecimal digit to convert + * @return an int equals to {@code hexDigit} + * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit */ public static int hexDigitMsb0ToInt(final char hexChar) { switch (hexChar) { @@ -666,9 +666,9 @@ public static int hexDigitMsb0ToInt(final char hexChar) { * '1' is converted as follow: (1, 0, 0, 0). *

    * - * @param hexChar the hexadecimal digit to convert. - * @return a boolean array with the binary representation of {@code hexDigit}. - * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit. + * @param hexChar the hexadecimal digit to convert + * @return a boolean array with the binary representation of {@code hexDigit} + * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit */ public static boolean[] hexDigitToBinary(final char hexChar) { switch (hexChar) { @@ -722,9 +722,9 @@ public static boolean[] hexDigitToBinary(final char hexChar) { * '1' is converted to 1 *

    * - * @param hexChar the hexadecimal digit to convert. - * @return an int equals to {@code hexDigit}. - * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit. + * @param hexChar the hexadecimal digit to convert + * @return an int equals to {@code hexDigit} + * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit */ public static int hexDigitToInt(final char hexChar) { final int digit = Character.digit(hexChar, 16); @@ -737,13 +737,13 @@ public static int hexDigitToInt(final char hexChar) { /** * Converts a hexadecimal string into a byte using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the hexadecimal string to convert. - * @param srcPos the position in {@code src}, in char unit, from where to start the conversion. - * @param dstInit initial value of the destination byte. - * @param dstPos the position of the LSB, in bits, in the result byte. - * @param nHex the number of Chars to convert. - * @return a byte containing the selected bits. - * @throws IllegalArgumentException if {@code (nHex-1)*4+dstPos >= 8}. + * @param src the hexadecimal string to convert + * @param srcPos the position in {@code src}, in char unit, from where to start the conversion + * @param dstInit initial value of the destination byte + * @param dstPos the position of the LSB, in bits, in the result byte + * @param nHex the number of Chars to convert + * @return a byte containing the selected bits + * @throws IllegalArgumentException if {@code (nHex-1)*4+dstPos >= 8} */ public static byte hexToByte(final String src, final int srcPos, final byte dstInit, final int dstPos, final int nHex) { if (0 == nHex) { @@ -765,13 +765,13 @@ public static byte hexToByte(final String src, final int srcPos, final byte dstI /** * Converts an array of char into an int using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the hexadecimal string to convert. - * @param srcPos the position in {@code src}, in char unit, from where to start the conversion. - * @param dstInit initial value of the destination int. - * @param dstPos the position of the LSB, in bits, in the result int. - * @param nHex the number of chars to convert. - * @return an int containing the selected bits. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + dstPos >= 32}. + * @param src the hexadecimal string to convert + * @param srcPos the position in {@code src}, in char unit, from where to start the conversion + * @param dstInit initial value of the destination int + * @param dstPos the position of the LSB, in bits, in the result int + * @param nHex the number of chars to convert + * @return an int containing the selected bits + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + dstPos >= 32} */ public static int hexToInt(final String src, final int srcPos, final int dstInit, final int dstPos, final int nHex) { if (0 == nHex) { @@ -793,13 +793,13 @@ public static int hexToInt(final String src, final int srcPos, final int dstInit /** * Converts an array of char into a long using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the hexadecimal string to convert. - * @param srcPos the position in {@code src}, in char unit, from where to start the conversion. - * @param dstInit initial value of the destination long. - * @param dstPos the position of the LSB, in bits, in the result long. - * @param nHex the number of chars to convert. - * @return a long containing the selected bits. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + dstPos >= 64}. + * @param src the hexadecimal string to convert + * @param srcPos the position in {@code src}, in char unit, from where to start the conversion + * @param dstInit initial value of the destination long + * @param dstPos the position of the LSB, in bits, in the result long + * @param nHex the number of chars to convert + * @return a long containing the selected bits + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + dstPos >= 64} */ public static long hexToLong(final String src, final int srcPos, final long dstInit, final int dstPos, final int nHex) { if (0 == nHex) { @@ -821,13 +821,13 @@ public static long hexToLong(final String src, final int srcPos, final long dstI /** * Converts an array of char into a short using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the hexadecimal string to convert. - * @param srcPos the position in {@code src}, in char unit, from where to start the conversion. - * @param dstInit initial value of the destination short. - * @param dstPos the position of the LSB, in bits, in the result short. - * @param nHex the number of chars to convert. - * @return a short containing the selected bits. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + dstPos >= 16}. + * @param src the hexadecimal string to convert + * @param srcPos the position in {@code src}, in char unit, from where to start the conversion + * @param dstInit initial value of the destination short + * @param dstPos the position of the LSB, in bits, in the result short + * @param nHex the number of chars to convert + * @return a short containing the selected bits + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + dstPos >= 16} */ public static short hexToShort(final String src, final int srcPos, final short dstInit, final int dstPos, final int nHex) { if (0 == nHex) { @@ -849,15 +849,15 @@ public static short hexToShort(final String src, final int srcPos, final short d /** * Converts an array of int into a long using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the int array to convert. - * @param srcPos the position in {@code src}, in int unit, from where to start the conversion. - * @param dstInit initial value of the destination long. - * @param dstPos the position of the LSB, in bits, in the result long. - * @param nInts the number of ints to convert. - * @return a long containing the selected bits. - * @throws IllegalArgumentException if {@code (nInts - 1) * 32 + dstPos >= 64}. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nInts > src.length}. + * @param src the int array to convert + * @param srcPos the position in {@code src}, in int unit, from where to start the conversion + * @param dstInit initial value of the destination long + * @param dstPos the position of the LSB, in bits, in the result long + * @param nInts the number of ints to convert + * @return a long containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nInts > src.length} + * @throws IllegalArgumentException if {@code (nInts - 1) * 32 + dstPos >= 64} + * @throws NullPointerException if {@code src} is {@code null} */ public static long intArrayToLong(final int[] src, final int srcPos, final long dstInit, final int dstPos, final int nInts) { if (src.length == 0 && srcPos == 0 || 0 == nInts) { @@ -879,15 +879,15 @@ public static long intArrayToLong(final int[] src, final int srcPos, final long /** * Converts an int into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the int to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 32}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length}. + * @param src the int to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length} + * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 32} + * @throws NullPointerException if {@code dst} is {@code null} */ public static boolean[] intToBinary(final int src, final int srcPos, final boolean[] dst, final int dstPos, final int nBools) { if (0 == nBools) { @@ -906,15 +906,15 @@ public static boolean[] intToBinary(final int src, final int srcPos, final boole /** * Converts an int into an array of byte using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the int to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + srcPos >= 32}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length}. + * @param src the int to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length} + * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + srcPos >= 32} + * @throws NullPointerException if {@code dst} is {@code null} */ public static byte[] intToByteArray(final int src, final int srcPos, final byte[] dst, final int dstPos, final int nBytes) { if (0 == nBytes) { @@ -933,14 +933,14 @@ public static byte[] intToByteArray(final int src, final int srcPos, final byte[ /** * Converts an int into an array of char using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the int to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dstInit the initial value for the result String. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 32}. - * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos}. + * @param src the int to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dstInit the initial value for the result String + * @param dstPos the position in {@code dst} where to copy the result + * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 32} + * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos} */ public static String intToHex(final int src, final int srcPos, final String dstInit, final int dstPos, final int nHexs) { if (0 == nHexs) { @@ -977,9 +977,9 @@ public static String intToHex(final int src, final int srcPos, final String dstI * 10 returns 'A' and so on... *

    * - * @param nibble the 4 bits to convert. - * @return a hexadecimal digit representing the 4 LSB of {@code nibble}. - * @throws IllegalArgumentException if {@code nibble < 0} or {@code nibble > 15}. + * @param nibble the 4 bits to convert + * @return a hexadecimal digit representing the 4 LSB of {@code nibble} + * @throws IllegalArgumentException if {@code nibble < 0} or {@code nibble > 15} */ public static char intToHexDigit(final int nibble) { final char c = Character.forDigit(nibble, 16); @@ -1002,9 +1002,9 @@ public static char intToHexDigit(final int nibble) { * 10 returns '5' and so on... *

    * - * @param nibble the 4 bits to convert. - * @return a hexadecimal digit representing the 4 LSB of {@code nibble}. - * @throws IllegalArgumentException if {@code nibble < 0} or {@code nibble > 15}. + * @param nibble the 4 bits to convert + * @return a hexadecimal digit representing the 4 LSB of {@code nibble} + * @throws IllegalArgumentException if {@code nibble < 0} or {@code nibble > 15} */ public static char intToHexDigitMsb0(final int nibble) { switch (nibble) { @@ -1048,15 +1048,15 @@ public static char intToHexDigitMsb0(final int nibble) { /** * Converts an int into an array of short using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the int to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nShorts the number of shorts to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + srcPos >= 32}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nShorts > dst.length}. + * @param src the int to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nShorts the number of shorts to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nShorts > dst.length} + * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + srcPos >= 32} + * @throws NullPointerException if {@code dst} is {@code null} */ public static short[] intToShortArray(final int src, final int srcPos, final short[] dst, final int dstPos, final int nShorts) { if (0 == nShorts) { @@ -1075,15 +1075,15 @@ public static short[] intToShortArray(final int src, final int srcPos, final sho /** * Converts a long into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the long to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length}. + * @param src the long to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length} + * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 64} + * @throws NullPointerException if {@code dst} is {@code null} */ public static boolean[] longToBinary(final long src, final int srcPos, final boolean[] dst, final int dstPos, final int nBools) { if (0 == nBools) { @@ -1102,15 +1102,15 @@ public static boolean[] longToBinary(final long src, final int srcPos, final boo /** * Converts a long into an array of byte using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the long to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + srcPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length}. + * @param src the long to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length} + * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + srcPos >= 64} + * @throws NullPointerException if {@code dst} is {@code null} */ public static byte[] longToByteArray(final long src, final int srcPos, final byte[] dst, final int dstPos, final int nBytes) { if (0 == nBytes) { @@ -1129,14 +1129,14 @@ public static byte[] longToByteArray(final long src, final int srcPos, final byt /** * Converts a long into an array of char using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the long to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dstInit the initial value for the result String. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 64}. - * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos}. + * @param src the long to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dstInit the initial value for the result String + * @param dstPos the position in {@code dst} where to copy the result + * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 64} + * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos} */ public static String longToHex(final long src, final int srcPos, final String dstInit, final int dstPos, final int nHexs) { if (0 == nHexs) { @@ -1163,15 +1163,15 @@ public static String longToHex(final long src, final int srcPos, final String ds /** * Converts a long into an array of int using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the long to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nInts the number of ints to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null} and {@code nInts > 0}. - * @throws IllegalArgumentException if {@code (nInts - 1) * 32 + srcPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nInts > dst.length}. + * @param src the long to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nInts the number of ints to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nInts > dst.length} + * @throws IllegalArgumentException if {@code (nInts - 1) * 32 + srcPos >= 64} + * @throws NullPointerException if {@code dst} is {@code null} and {@code nInts > 0} */ public static int[] longToIntArray(final long src, final int srcPos, final int[] dst, final int dstPos, final int nInts) { if (0 == nInts) { @@ -1190,15 +1190,15 @@ public static int[] longToIntArray(final long src, final int srcPos, final int[] /** * Converts a long into an array of short using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the long to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nShorts the number of shorts to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + srcPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nShorts > dst.length}. + * @param src the long to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nShorts the number of shorts to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nShorts > dst.length} + * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + srcPos >= 64} + * @throws NullPointerException if {@code dst} is {@code null} */ public static short[] longToShortArray(final long src, final int srcPos, final short[] dst, final int dstPos, final int nShorts) { if (0 == nShorts) { @@ -1217,15 +1217,15 @@ public static short[] longToShortArray(final long src, final int srcPos, final s /** * Converts an array of short into an int using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the short array to convert. - * @param srcPos the position in {@code src}, in short unit, from where to start the conversion. - * @param dstInit initial value of the destination int. - * @param dstPos the position of the LSB, in bits, in the result int. - * @param nShorts the number of shorts to convert. - * @return an int containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + dstPos >= 32}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nShorts > src.length}. + * @param src the short array to convert + * @param srcPos the position in {@code src}, in short unit, from where to start the conversion + * @param dstInit initial value of the destination int + * @param dstPos the position of the LSB, in bits, in the result int + * @param nShorts the number of shorts to convert + * @return an int containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nShorts > src.length} + * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + dstPos >= 32} + * @throws NullPointerException if {@code src} is {@code null} */ public static int shortArrayToInt(final short[] src, final int srcPos, final int dstInit, final int dstPos, final int nShorts) { if (src.length == 0 && srcPos == 0 || 0 == nShorts) { @@ -1247,15 +1247,15 @@ public static int shortArrayToInt(final short[] src, final int srcPos, final int /** * Converts an array of short into a long using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the short array to convert. - * @param srcPos the position in {@code src}, in short unit, from where to start the conversion. - * @param dstInit initial value of the destination long. - * @param dstPos the position of the LSB, in bits, in the result long. - * @param nShorts the number of shorts to convert. - * @return a long containing the selected bits. - * @throws NullPointerException if {@code src} is {@code null}. - * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + dstPos >= 64}. - * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nShorts > src.length}. + * @param src the short array to convert + * @param srcPos the position in {@code src}, in short unit, from where to start the conversion + * @param dstInit initial value of the destination long + * @param dstPos the position of the LSB, in bits, in the result long + * @param nShorts the number of shorts to convert + * @return a long containing the selected bits + * @throws ArrayIndexOutOfBoundsException if {@code srcPos + nShorts > src.length} + * @throws IllegalArgumentException if {@code (nShorts - 1) * 16 + dstPos >= 64} + * @throws NullPointerException if {@code src} is {@code null} */ public static long shortArrayToLong(final short[] src, final int srcPos, final long dstInit, final int dstPos, final int nShorts) { if (src.length == 0 && srcPos == 0 || 0 == nShorts) { @@ -1277,15 +1277,15 @@ public static long shortArrayToLong(final short[] src, final int srcPos, final l /** * Converts a short into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the short to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 16}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length}. + * @param src the short to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBools the number of booleans to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBools > dst.length} + * @throws IllegalArgumentException if {@code nBools - 1 + srcPos >= 16} + * @throws NullPointerException if {@code dst} is {@code null} */ public static boolean[] shortToBinary(final short src, final int srcPos, final boolean[] dst, final int dstPos, final int nBools) { if (0 == nBools) { @@ -1305,15 +1305,15 @@ public static boolean[] shortToBinary(final short src, final int srcPos, final b /** * Converts a short into an array of byte using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the short to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + srcPos >= 16}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length}. + * @param src the short to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length} + * @throws IllegalArgumentException if {@code (nBytes - 1) * 8 + srcPos >= 16} + * @throws NullPointerException if {@code dst} is {@code null} */ public static byte[] shortToByteArray(final short src, final int srcPos, final byte[] dst, final int dstPos, final int nBytes) { if (0 == nBytes) { @@ -1332,14 +1332,14 @@ public static byte[] shortToByteArray(final short src, final int srcPos, final b /** * Converts a short into an array of char using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the short to convert. - * @param srcPos the position in {@code src}, in bits, from where to start the conversion. - * @param dstInit the initial value for the result String. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 16}. - * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos}. + * @param src the short to convert + * @param srcPos the position in {@code src}, in bits, from where to start the conversion + * @param dstInit the initial value for the result String + * @param dstPos the position in {@code dst} where to copy the result + * @param nHexs the number of chars to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws IllegalArgumentException if {@code (nHexs - 1) * 4 + srcPos >= 16} + * @throws StringIndexOutOfBoundsException if {@code dst.init.length() < dstPos} */ public static String shortToHex(final short src, final int srcPos, final String dstInit, final int dstPos, final int nHexs) { if (0 == nHexs) { @@ -1366,14 +1366,14 @@ public static String shortToHex(final short src, final int srcPos, final String /** * Converts UUID into an array of byte using the default (little-endian, LSB0) byte and bit ordering. * - * @param src the UUID to convert. - * @param dst the destination array. - * @param dstPos the position in {@code dst} where to copy the result. - * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB). - * @return {@code dst}. - * @throws NullPointerException if {@code dst} is {@code null}. - * @throws IllegalArgumentException if {@code nBytes > 16}. - * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length}. + * @param src the UUID to convert + * @param dst the destination array + * @param dstPos the position in {@code dst} where to copy the result + * @param nBytes the number of bytes to copy to {@code dst}, must be smaller or equal to the width of the input (from srcPos to MSB) + * @return {@code dst} + * @throws ArrayIndexOutOfBoundsException if {@code dstPos + nBytes > dst.length} + * @throws IllegalArgumentException if {@code nBytes > 16} + * @throws NullPointerException if {@code dst} is {@code null} */ public static byte[] uuidToByteArray(final UUID src, final byte[] dst, final int dstPos, final int nBytes) { if (0 == nBytes) { diff --git a/src/main/java/org/apache/commons/lang3/DoubleRange.java b/src/main/java/org/apache/commons/lang3/DoubleRange.java index 060f4116e5a..fd4f9d12ec8 100644 --- a/src/main/java/org/apache/commons/lang3/DoubleRange.java +++ b/src/main/java/org/apache/commons/lang3/DoubleRange.java @@ -41,9 +41,9 @@ public final class DoubleRange extends NumberRange { * The arguments may be passed in the order (min, max) or (max,min). The getMinimum and getMaximum methods will return the correct values. *

    * - * @param fromInclusive the first value that defines the edge of the range, inclusive. - * @param toInclusive the second value that defines the edge of the range, inclusive. - * @return the range object, not null. + * @param fromInclusive the first value that defines the edge of the range, inclusive + * @param toInclusive the second value that defines the edge of the range, inclusive + * @return the range object, not null */ public static DoubleRange of(final double fromInclusive, final double toInclusive) { return of(Double.valueOf(fromInclusive), Double.valueOf(toInclusive)); @@ -60,10 +60,10 @@ public static DoubleRange of(final double fromInclusive, final double toInclusiv * The arguments may be passed in the order (min, max) or (max,min). The getMinimum and getMaximum methods will return the correct values. *

    * - * @param fromInclusive the first value that defines the edge of the range, inclusive. - * @param toInclusive the second value that defines the edge of the range, inclusive. - * @return the range object, not null. - * @throws NullPointerException if either element is null. + * @param fromInclusive the first value that defines the edge of the range, inclusive + * @param toInclusive the second value that defines the edge of the range, inclusive + * @return the range object, not null + * @throws NullPointerException if either element is null */ public static DoubleRange of(final Double fromInclusive, final Double toInclusive) { return new DoubleRange(fromInclusive, toInclusive); @@ -72,10 +72,10 @@ public static DoubleRange of(final Double fromInclusive, final Double toInclusiv /** * Creates an instance. * - * @param number1 the first element, not null. - * @param number2 the second element, not null. - * @throws NullPointerException when element1 is null. - * @throws NullPointerException when element2 is null. + * @param number1 the first element, not null + * @param number2 the second element, not null + * @throws NullPointerException when element1 is null + * @throws NullPointerException when element2 is null */ private DoubleRange(final Double number1, final Double number2) { super(number1, number2, null); @@ -98,8 +98,8 @@ private DoubleRange(final Double number1, final Double number2) { * range.fit(99) --> 64 * } * - * @param element the element to test. - * @return the minimum, the element, or the maximum depending on the element's location relative to the range. + * @param element the element to test + * @return the minimum, the element, or the maximum depending on the element's location relative to the range * @since 3.19.0 */ public double fit(final double element) { diff --git a/src/main/java/org/apache/commons/lang3/EnumUtils.java b/src/main/java/org/apache/commons/lang3/EnumUtils.java index 513b3140ae5..79c51c16eb3 100644 --- a/src/main/java/org/apache/commons/lang3/EnumUtils.java +++ b/src/main/java/org/apache/commons/lang3/EnumUtils.java @@ -47,11 +47,11 @@ public class EnumUtils { /** * Validate {@code enumClass}. * - * @param the type of the enumeration. - * @param enumClass to check. - * @return {@code enumClass}. - * @throws NullPointerException if {@code enumClass} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class. + * @param the type of the enumeration + * @param enumClass to check + * @return {@code enumClass} + * @throws IllegalArgumentException if {@code enumClass} is not an enum class + * @throws NullPointerException if {@code enumClass} is {@code null} * @since 3.2 */ private static > Class asEnum(final Class enumClass) { @@ -63,11 +63,11 @@ private static > Class asEnum(final Class enumClass) { /** * Validate that {@code enumClass} is compatible with representation in a {@code long}. * - * @param the type of the enumeration. - * @param enumClass to check. - * @return {@code enumClass}. - * @throws NullPointerException if {@code enumClass} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values. + * @param the type of the enumeration + * @param enumClass to check + * @return {@code enumClass} + * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values + * @throws NullPointerException if {@code enumClass} is {@code null} * @since 3.0.1 */ private static > Class checkBitVectorable(final Class enumClass) { @@ -85,14 +85,14 @@ private static > Class checkBitVectorable(final Class en *

    Do not use this method if you have more than 64 values in your Enum, as this * would create a value greater than a long can hold.

    * - * @param enumClass the class of the enum we are working with, not {@code null}. - * @param values the values we want to convert, not {@code null}. - * @param the type of the enumeration. - * @return a long whose value provides a binary representation of the given set of enum values. - * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values. - * @since 3.0.1 + * @param enumClass the class of the enum we are working with, not {@code null} + * @param values the values we want to convert, not {@code null} + * @param the type of the enumeration + * @return a long whose value provides a binary representation of the given set of enum values + * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values + * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null} * @see #generateBitVectors(Class, Iterable) + * @since 3.0.1 */ @SafeVarargs public static > long generateBitVector(final Class enumClass, final E... values) { @@ -108,15 +108,15 @@ public static > long generateBitVector(final Class enumClas *

    Do not use this method if you have more than 64 values in your Enum, as this * would create a value greater than a long can hold.

    * - * @param enumClass the class of the enum we are working with, not {@code null}. - * @param values the values we want to convert, not {@code null}, neither containing {@code null}. - * @param the type of the enumeration. - * @return a long whose value provides a binary representation of the given set of enum values. - * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null}. + * @param enumClass the class of the enum we are working with, not {@code null} + * @param values the values we want to convert, not {@code null}, neither containing {@code null} + * @param the type of the enumeration + * @return a long whose value provides a binary representation of the given set of enum values * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values, - * or if any {@code values} {@code null}. - * @since 3.0.1 + * or if any {@code values} {@code null} + * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null} * @see #generateBitVectors(Class, Iterable) + * @since 3.0.1 */ public static > long generateBitVector(final Class enumClass, final Iterable values) { checkBitVectorable(enumClass); @@ -136,13 +136,13 @@ public static > long generateBitVector(final Class enumClas * *

    Use this method if you have more than 64 values in your Enum.

    * - * @param enumClass the class of the enum we are working with, not {@code null}. - * @param values the values we want to convert, not {@code null}, neither containing {@code null}. - * @param the type of the enumeration. + * @param enumClass the class of the enum we are working with, not {@code null} + * @param values the values we want to convert, not {@code null}, neither containing {@code null} + * @param the type of the enumeration * @return a long[] whose values provide a binary representation of the given set of enum values - * with the least significant digits rightmost. - * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class, or if any {@code values} {@code null}. + * with the least significant digits rightmost + * @throws IllegalArgumentException if {@code enumClass} is not an enum class, or if any {@code values} {@code null} + * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null} * @since 3.2 */ @SafeVarargs @@ -166,13 +166,13 @@ public static > long[] generateBitVectors(final Class enumC * *

    Use this method if you have more than 64 values in your Enum.

    * - * @param enumClass the class of the enum we are working with, not {@code null}. - * @param values the values we want to convert, not {@code null}, neither containing {@code null}. - * @param the type of the enumeration. + * @param enumClass the class of the enum we are working with, not {@code null} + * @param values the values we want to convert, not {@code null}, neither containing {@code null} + * @param the type of the enumeration * @return a long[] whose values provide a binary representation of the given set of enum values - * with the least significant digits rightmost. - * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class, or if any {@code values} {@code null}. + * with the least significant digits rightmost + * @throws IllegalArgumentException if {@code enumClass} is not an enum class, or if any {@code values} {@code null} + * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null} * @since 3.2 */ public static > long[] generateBitVectors(final Class enumClass, final Iterable values) { @@ -194,10 +194,10 @@ public static > long[] generateBitVectors(final Class enumC *

    This method differs from {@link Enum#valueOf} in that it does not throw an exception * for an invalid enum name.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, not null. - * @param enumName the enum name, null returns null. - * @return the enum, null if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, not null + * @param enumName the enum name, null returns null + * @return the enum, null if not found */ public static > E getEnum(final Class enumClass, final String enumName) { return getEnum(enumClass, enumName, null); @@ -209,11 +209,11 @@ public static > E getEnum(final Class enumClass, final Stri *

    This method differs from {@link Enum#valueOf} in that it does not throw an exception * for an invalid enum name.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, null returns default enum. - * @param enumName the enum name, null returns default enum. - * @param defaultEnum the default enum. - * @return the enum, default enum if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, null returns default enum + * @param enumName the enum name, null returns default enum + * @param defaultEnum the default enum + * @return the enum, default enum if not found * @since 3.10 */ public static > E getEnum(final Class enumClass, final String enumName, final E defaultEnum) { @@ -233,10 +233,10 @@ public static > E getEnum(final Class enumClass, final Stri *

    This method differs from {@link Enum#valueOf} in that it does not throw an exception * for an invalid enum name and performs case insensitive matching of the name.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, may be null. - * @param enumName the enum name, null returns null. - * @return the enum, null if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, may be null + * @param enumName the enum name, null returns null + * @return the enum, null if not found * @since 3.8 */ public static > E getEnumIgnoreCase(final Class enumClass, final String enumName) { @@ -249,11 +249,11 @@ public static > E getEnumIgnoreCase(final Class enumClass, *

    This method differs from {@link Enum#valueOf} in that it does not throw an exception * for an invalid enum name and performs case insensitive matching of the name.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, null returns default enum. - * @param enumName the enum name, null returns default enum. - * @param defaultEnum the default enum. - * @return the enum, default enum if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, null returns default enum + * @param enumName the enum name, null returns default enum + * @param defaultEnum the default enum + * @return the enum, default enum if not found * @since 3.10 */ public static > E getEnumIgnoreCase(final Class enumClass, final String enumName, @@ -266,9 +266,9 @@ public static > E getEnumIgnoreCase(final Class enumClass, * *

    This method is useful when you need a list of enums rather than an array.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, not null. - * @return the modifiable list of enums, never null. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, not null + * @return the modifiable list of enums, never null */ public static > List getEnumList(final Class enumClass) { return new ArrayList<>(Arrays.asList(enumClass.getEnumConstants())); @@ -279,9 +279,9 @@ public static > List getEnumList(final Class enumClass) * *

    This method is useful when you need a map of enums by name.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, not null. - * @return the modifiable map of enum names to enums, never null. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, not null + * @return the modifiable map of enum names to enums, never null */ public static > Map getEnumMap(final Class enumClass) { return getEnumMap(enumClass, E::name); @@ -294,11 +294,11 @@ public static > Map getEnumMap(final Class enumC * This method is useful when you need a map of enums by name. *

    * - * @param the type of enumeration. - * @param the type of the map key. - * @param enumClass the class of the enum to query, not null. - * @param keyFunction the function to query for the key, not null. - * @return the modifiable map of enums, never null. + * @param the type of enumeration + * @param the type of the map key + * @param enumClass the class of the enum to query, not null + * @param keyFunction the function to query for the key, not null + * @return the modifiable map of enums, never null * @since 3.13.0 */ public static , K> Map getEnumMap(final Class enumClass, final Function keyFunction) { @@ -315,11 +315,11 @@ public static , K> Map getEnumMap(final Class enumCla * If a {@link SecurityException} is caught, the return value is {@code null}. *

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, not null. - * @param propName the system property key for the enum name, null returns default enum. - * @param defaultEnum the default enum. - * @return the enum, default enum if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, not null + * @param propName the system property key for the enum name, null returns default enum + * @param defaultEnum the default enum + * @return the enum, default enum if not found * @since 3.13.0 */ public static > E getEnumSystemProperty(final Class enumClass, final String propName, final E defaultEnum) { @@ -334,12 +334,12 @@ public static > E getEnumSystemProperty(final Class enumCla * the name. *

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, not null. - * @param value the enum name, null returns default enum. - * @param toIntFunction the function that gets an int for an enum for comparison to {@code value}. - * @param defaultEnum the default enum. - * @return an enum, default enum if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, not null + * @param value the enum name, null returns default enum + * @param toIntFunction the function that gets an int for an enum for comparison to {@code value} + * @param defaultEnum the default enum + * @return an enum, default enum if not found * @since 3.18.0 */ public static > E getFirstEnum(final Class enumClass, final int value, final ToIntFunction toIntFunction, final E defaultEnum) { @@ -355,12 +355,12 @@ public static > E getFirstEnum(final Class enumClass, final *

    This method differs from {@link Enum#valueOf} in that it does not throw an exception * for an invalid enum name and performs case insensitive matching of the name.

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, null returns default enum. - * @param enumName the enum name, null returns default enum. - * @param stringFunction the function that gets the string for an enum for comparison to {@code enumName}. - * @param defaultEnum the default enum. - * @return an enum, default enum if not found. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, null returns default enum + * @param enumName the enum name, null returns default enum + * @param stringFunction the function that gets the string for an enum for comparison to {@code enumName} + * @param defaultEnum the default enum + * @return an enum, default enum if not found * @since 3.13.0 */ public static > E getFirstEnumIgnoreCase(final Class enumClass, final String enumName, final Function stringFunction, @@ -382,10 +382,10 @@ private static > boolean isEnum(final Class enumClass) { * This method differs from {@link Enum#valueOf} in that it checks if the name is a valid enum without needing to catch the exception. *

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, null returns false. - * @param enumName the enum name, null returns false. - * @return true if the enum name is valid, otherwise false. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, null returns false + * @param enumName the enum name, null returns false + * @return true if the enum name is valid, otherwise false */ public static > boolean isValidEnum(final Class enumClass, final String enumName) { return getEnum(enumClass, enumName) != null; @@ -399,10 +399,10 @@ public static > boolean isValidEnum(final Class enumClass, * insensitive matching of the name. *

    * - * @param the type of the enumeration. - * @param enumClass the class of the enum to query, null returns false. - * @param enumName the enum name, null returns false. - * @return true if the enum name is valid, otherwise false. + * @param the type of the enumeration + * @param enumClass the class of the enum to query, null returns false + * @param enumName the enum name, null returns false + * @return true if the enum name is valid, otherwise false * @since 3.8 */ public static > boolean isValidEnumIgnoreCase(final Class enumClass, final String enumName) { @@ -415,12 +415,12 @@ public static > boolean isValidEnumIgnoreCase(final Class e * *

    If you store this value, beware any changes to the enum that would affect ordinal values.

    * - * @param enumClass the class of the enum we are working with, not {@code null}. - * @param value the long value representation of a set of enum values. - * @param the type of the enumeration. - * @return a set of enum values. - * @throws NullPointerException if {@code enumClass} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values. + * @param enumClass the class of the enum we are working with, not {@code null} + * @param value the long value representation of a set of enum values + * @param the type of the enumeration + * @return a set of enum values + * @throws IllegalArgumentException if {@code enumClass} is not an enum class or has more than 64 values + * @throws NullPointerException if {@code enumClass} is {@code null} * @since 3.0.1 */ public static > EnumSet processBitVector(final Class enumClass, final long value) { @@ -433,12 +433,12 @@ public static > EnumSet processBitVector(final Class enu * *

    If you store this value, beware any changes to the enum that would affect ordinal values.

    * - * @param enumClass the class of the enum we are working with, not {@code null}. - * @param values the long[] bearing the representation of a set of enum values, the least significant digits rightmost, not {@code null}. - * @param the type of the enumeration. - * @return a set of enum values. - * @throws NullPointerException if {@code enumClass} is {@code null}. - * @throws IllegalArgumentException if {@code enumClass} is not an enum class. + * @param enumClass the class of the enum we are working with, not {@code null} + * @param values the long[] bearing the representation of a set of enum values, the least significant digits rightmost, not {@code null} + * @param the type of the enumeration + * @return a set of enum values + * @throws IllegalArgumentException if {@code enumClass} is not an enum class + * @throws NullPointerException if {@code enumClass} is {@code null} * @since 3.2 */ public static > EnumSet processBitVectors(final Class enumClass, final long... values) { @@ -457,11 +457,11 @@ public static > EnumSet processBitVectors(final Class en /** * Returns a sequential ordered stream whose elements are the given class' enum values. * - * @param the type of stream elements. - * @param clazz the class containing the enum values, may be null. - * @return the new stream, empty of {@code clazz} is null. - * @since 3.18.0 + * @param the type of stream elements + * @param clazz the class containing the enum values, may be null + * @return the new stream, empty of {@code clazz} is null * @see Class#getEnumConstants() + * @since 3.18.0 */ public static Stream stream(final Class clazz) { return clazz != null ? Streams.of(clazz.getEnumConstants()) : Stream.empty(); diff --git a/src/main/java/org/apache/commons/lang3/Functions.java b/src/main/java/org/apache/commons/lang3/Functions.java index 70f0aaf3927..5b5b5fc09bd 100644 --- a/src/main/java/org/apache/commons/lang3/Functions.java +++ b/src/main/java/org/apache/commons/lang3/Functions.java @@ -80,9 +80,9 @@ public class Functions { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Consumed type 1. - * @param Consumed type 2. - * @param Thrown exception. + * @param consumed type 1 + * @param consumed type 2 + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableBiConsumer}. */ @Deprecated @@ -94,7 +94,7 @@ public interface FailableBiConsumer { * * @param object1 the first parameter for the consumable to accept * @param object2 the second parameter for the consumable to accept - * @throws T Thrown when the consumer fails. + * @throws T thrown when the consumer fails */ void accept(O1 object1, O2 object2) throws T; } @@ -104,10 +104,10 @@ public interface FailableBiConsumer { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Input type 1. - * @param Input type 2. - * @param Return type. - * @param Thrown exception. + * @param input type 1 + * @param input type 2 + * @param return type + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableBiFunction}. */ @Deprecated @@ -120,7 +120,7 @@ public interface FailableBiFunction { * @param input1 the first input for the function * @param input2 the second input for the function * @return the result of the function - * @throws T Thrown when the function fails. + * @throws T thrown when the function fails */ R apply(O1 input1, O2 input2) throws T; } @@ -130,9 +130,9 @@ public interface FailableBiFunction { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Predicate type 1. - * @param Predicate type 2. - * @param Thrown exception. + * @param predicate type 1 + * @param predicate type 2 + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableBiPredicate}. */ @Deprecated @@ -155,8 +155,8 @@ public interface FailableBiPredicate { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Return type. - * @param Thrown exception. + * @param return type + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableCallable}. */ @Deprecated @@ -166,7 +166,7 @@ public interface FailableCallable { /** * Calls the callable. * - * @return The value returned from the callable + * @return the value returned from the callable * @throws T if the callable fails */ R call() throws T; @@ -177,8 +177,8 @@ public interface FailableCallable { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Consumed type 1. - * @param Thrown exception. + * @param consumed type 1 + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableConsumer}. */ @Deprecated @@ -189,7 +189,7 @@ public interface FailableConsumer { * Accepts the consumer. * * @param object the parameter for the consumable to accept - * @throws T Thrown when the consumer fails. + * @throws T thrown when the consumer fails */ void accept(O object) throws T; } @@ -199,9 +199,9 @@ public interface FailableConsumer { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Input type 1. - * @param Return type. - * @param Thrown exception. + * @param input type 1 + * @param return type + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableFunction}. */ @Deprecated @@ -213,7 +213,7 @@ public interface FailableFunction { * * @param input the input for the function * @return the result of the function - * @throws T Thrown when the function fails. + * @throws T thrown when the function fails */ R apply(I input) throws T; } @@ -223,8 +223,8 @@ public interface FailableFunction { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Predicate type 1. - * @param Thrown exception. + * @param predicate type 1 + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailablePredicate}. */ @Deprecated @@ -246,7 +246,7 @@ public interface FailablePredicate { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Thrown exception. + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableRunnable}. */ @Deprecated @@ -256,7 +256,7 @@ public interface FailableRunnable { /** * Runs the function. * - * @throws T Thrown when the function fails. + * @throws T thrown when the function fails */ void run() throws T; } @@ -266,8 +266,8 @@ public interface FailableRunnable { * *

    TODO for 4.0: Move to org.apache.commons.lang3.function.

    * - * @param Return type. - * @param Thrown exception. + * @param return type + * @param thrown exception * @deprecated Use {@link org.apache.commons.lang3.function.FailableSupplier}. */ @Deprecated @@ -275,7 +275,7 @@ public interface FailableRunnable { public interface FailableSupplier { /** - * Supplies an object + * Supplies an object. * * @return a result * @throws T if the supplier fails @@ -468,10 +468,10 @@ public static O call(final FailableCallable calla /** * Invokes a supplier, and returns the result. * - * @param supplier The supplier to invoke. - * @param The suppliers output type. - * @param The type of checked exception, which the supplier can throw. - * @return The object, which has been created by the supplier + * @param supplier the supplier to invoke + * @param the suppliers output type + * @param the type of checked exception, which the supplier can throw + * @return the object, which has been created by the supplier * @since 3.10 */ public static O get(final FailableSupplier supplier) { @@ -485,9 +485,9 @@ public static O get(final FailableSupplier suppli /** * Invokes a boolean supplier, and returns the result. * - * @param supplier The boolean supplier to invoke. - * @param The type of checked exception, which the supplier can throw. - * @return The boolean, which has been created by the supplier + * @param supplier the boolean supplier to invoke + * @param the type of checked exception, which the supplier can throw + * @return the boolean, which has been created by the supplier */ private static boolean getAsBoolean(final FailableBooleanSupplier supplier) { try { @@ -518,8 +518,8 @@ private static boolean getAsBoolean(final FailableBooleanS * follow the method call, like a {@code return} statement from a value returning method. *

    * - * @param throwable The throwable to rethrow possibly wrapped into an unchecked exception - * @return Never returns anything, this method never terminates normally. + * @param throwable the throwable to rethrow possibly wrapped into an unchecked exception + * @return never returns anything, this method never terminates normally */ public static RuntimeException rethrow(final Throwable throwable) { Objects.requireNonNull(throwable, "throwable"); @@ -533,7 +533,7 @@ public static RuntimeException rethrow(final Throwable throwable) { /** * Runs a runnable and rethrows any exception as a {@link RuntimeException}. * - * @param runnable The runnable to run + * @param runnable the runnable to run * @param the type of checked exception the runnable may throw */ public static void run(final FailableRunnable runnable) { @@ -551,9 +551,9 @@ public static void run(final FailableRunnable runnable) *
          * Functions.stream(collection.stream());
    * - * @param collection The collection, which is being converted into a {@link FailableStream}. - * @param The collections element type. (In turn, the result streams element type.) - * @return The created {@link FailableStream}. + * @param collection the collection, which is being converted into a {@link FailableStream} + * @param the collections element type. (In turn, the result streams element type.) + * @return the created {@link FailableStream} * @since 3.10 */ public static FailableStream stream(final Collection collection) { @@ -566,9 +566,9 @@ public static FailableStream stream(final Collection collection) { * {@link FailableFunction}, and {@link FailableConsumer} may be applied, rather than {@link Predicate}, * {@link Function}, {@link Consumer}, etc. * - * @param stream The stream, which is being converted into a {@link FailableStream}. - * @param The streams element type. - * @return The created {@link FailableStream}. + * @param stream the stream, which is being converted into a {@link FailableStream} + * @param the streams element type + * @return the created {@link FailableStream} * @since 3.10 */ public static FailableStream stream(final Stream stream) { @@ -617,10 +617,10 @@ public static boolean test(final FailablePredicate fis.close()); * } * - * @param action The action to execute. This object will always be invoked. - * @param errorHandler An optional error handler, which will be invoked finally, if any error occurred. The error + * @param action the action to execute. This object will always be invoked. + * @param errorHandler an optional error handler, which will be invoked finally, if any error occurred. The error * handler will receive the first error, AKA {@link Throwable}. - * @param resources The resource actions to execute. All resource actions will be invoked, in the given + * @param resources the resource actions to execute. All resource actions will be invoked, in the given * order. A resource action is an instance of {@link FailableRunnable}, which will be executed. * @see #tryWithResources(FailableRunnable, FailableRunnable...) */ @@ -646,8 +646,8 @@ public static void tryWithResources(final FailableRunnable * Functions.tryWithResources(useInputStream(fis), () -> fis.close()); * } * - * @param action The action to execute. This object will always be invoked. - * @param resources The resource actions to execute. All resource actions will be invoked, in the given + * @param action the action to execute. This object will always be invoked. + * @param resources the resource actions to execute. All resource actions will be invoked, in the given * order. A resource action is an instance of {@link FailableRunnable}, which will be executed. * @see #tryWithResources(FailableRunnable, FailableConsumer, FailableRunnable...) */ diff --git a/src/main/java/org/apache/commons/lang3/IntegerRange.java b/src/main/java/org/apache/commons/lang3/IntegerRange.java index 69dc1a58459..0062482ec91 100644 --- a/src/main/java/org/apache/commons/lang3/IntegerRange.java +++ b/src/main/java/org/apache/commons/lang3/IntegerRange.java @@ -43,9 +43,9 @@ public final class IntegerRange extends NumberRange { * The arguments may be passed in the order (min, max) or (max,min). The getMinimum and getMaximum methods will return the correct values. *

    * - * @param fromInclusive the first value that defines the edge of the range, inclusive. - * @param toInclusive the second value that defines the edge of the range, inclusive. - * @return the range object, not null. + * @param fromInclusive the first value that defines the edge of the range, inclusive + * @param toInclusive the second value that defines the edge of the range, inclusive + * @return the range object, not null */ public static IntegerRange of(final int fromInclusive, final int toInclusive) { return of(Integer.valueOf(fromInclusive), Integer.valueOf(toInclusive)); @@ -62,10 +62,10 @@ public static IntegerRange of(final int fromInclusive, final int toInclusive) { * The arguments may be passed in the order (min, max) or (max,min). The getMinimum and getMaximum methods will return the correct values. *

    * - * @param fromInclusive the first value that defines the edge of the range, inclusive. - * @param toInclusive the second value that defines the edge of the range, inclusive. - * @return the range object, not null. - * @throws NullPointerException if either element is null. + * @param fromInclusive the first value that defines the edge of the range, inclusive + * @param toInclusive the second value that defines the edge of the range, inclusive + * @return the range object, not null + * @throws NullPointerException if either element is null */ public static IntegerRange of(final Integer fromInclusive, final Integer toInclusive) { return new IntegerRange(fromInclusive, toInclusive); @@ -74,10 +74,10 @@ public static IntegerRange of(final Integer fromInclusive, final Integer toInclu /** * Creates a new instance. * - * @param number1 the first element, not null. - * @param number2 the second element, not null. - * @throws NullPointerException when element1 is null. - * @throws NullPointerException when element2 is null. + * @param number1 the first element, not null + * @param number2 the second element, not null + * @throws NullPointerException when element1 is null + * @throws NullPointerException when element2 is null */ private IntegerRange(final Integer number1, final Integer number2) { super(number1, number2, null); @@ -100,8 +100,8 @@ private IntegerRange(final Integer number1, final Integer number2) { * range.fit(99) --> 64 * } * - * @param element the element to test. - * @return the minimum, the element, or the maximum depending on the element's location relative to the range. + * @param element the element to test + * @return the minimum, the element, or the maximum depending on the element's location relative to the range * @since 3.19.0 */ public int fit(final int element) { @@ -112,7 +112,7 @@ public int fit(final int element) { * Returns a sequential ordered {@code IntStream} from {@link #getMinimum()} (inclusive) to {@link #getMaximum()} (inclusive) by an incremental step of * {@code 1}. * - * @return a sequential {@code IntStream} for the range of {@code int} elements. + * @return a sequential {@code IntStream} for the range of {@code int} elements * @since 3.18.0 */ public IntStream toIntStream() { diff --git a/src/main/java/org/apache/commons/lang3/JavaVersion.java b/src/main/java/org/apache/commons/lang3/JavaVersion.java index af13d4ae4d5..6424d33faa0 100644 --- a/src/main/java/org/apache/commons/lang3/JavaVersion.java +++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java @@ -220,8 +220,8 @@ public enum JavaVersion { /** * Transforms the given string with a Java version number to the corresponding constant of this enumeration class. This method is used internally. * - * @param versionStr the Java version as string. - * @return the corresponding enumeration constant or null if the version is unknown. + * @param versionStr the Java version as string + * @return the corresponding enumeration constant or null if the version is unknown */ static JavaVersion get(final String versionStr) { if (versionStr == null) { @@ -302,8 +302,8 @@ static JavaVersion get(final String versionStr) { /** * Transforms the given string with a Java version number to the corresponding constant of this enumeration class. This method is used internally. * - * @param versionStr the Java version as string. - * @return the corresponding enumeration constant or null if the version is unknown. + * @param versionStr the Java version as string + * @return the corresponding enumeration constant or null if the version is unknown */ static JavaVersion getJavaVersion(final String versionStr) { return get(versionStr); @@ -312,7 +312,7 @@ static JavaVersion getJavaVersion(final String versionStr) { /** * Gets the Java Version from the system or 99.0 if the {@code java.specification.version} system property is not set. * - * @return the value of {@code java.specification.version} system property or 99.0 if it is not set. + * @return the value of {@code java.specification.version} system property or 99.0 if it is not set */ private static float maxVersion() { final float v = toFloatVersion(SystemProperties.getJavaSpecificationVersion("99.0")); @@ -326,8 +326,8 @@ static String[] split(final String value) { /** * Parses a float value from a String. * - * @param value the String to parse. - * @return the float value represented by the string or -1 if the given String cannot be parsed. + * @param value the String to parse + * @return the float value represented by the string or -1 if the given String cannot be parsed */ private static float toFloatVersion(final String value) { final int defaultReturnValue = -1; @@ -354,8 +354,8 @@ private static float toFloatVersion(final String value) { /** * Constructs a new instance. * - * @param value the float value. - * @param name the standard name, not null. + * @param value the float value + * @param name the standard name, not null */ JavaVersion(final float value, final String name) { this.value = value; @@ -374,8 +374,8 @@ private static float toFloatVersion(final String value) { * myVersion.atLeast(JavaVersion.JAVA_1_8) * } * - * @param requiredVersion the version to check against, not null. - * @return true if this version is equal to or greater than the specified version. + * @param requiredVersion the version to check against, not null + * @return true if this version is equal to or greater than the specified version */ public boolean atLeast(final JavaVersion requiredVersion) { return this.value >= requiredVersion.value; @@ -393,8 +393,8 @@ public boolean atLeast(final JavaVersion requiredVersion) { * myVersion.atMost(JavaVersion.JAVA_1_4) * } * - * @param requiredVersion the version to check against, not null. - * @return true if this version is equal to or greater than the specified version. + * @param requiredVersion the version to check against, not null + * @return true if this version is equal to or greater than the specified version * @since 3.9 */ public boolean atMost(final JavaVersion requiredVersion) { @@ -408,7 +408,7 @@ public boolean atMost(final JavaVersion requiredVersion) { * For example, {@code "1.5"}. *

    * - * @return the name, not null. + * @return the name, not null */ @Override public String toString() { diff --git a/src/main/java/org/apache/commons/lang3/LocaleUtils.java b/src/main/java/org/apache/commons/lang3/LocaleUtils.java index 3b720a8c54c..b2c7d80182c 100644 --- a/src/main/java/org/apache/commons/lang3/LocaleUtils.java +++ b/src/main/java/org/apache/commons/lang3/LocaleUtils.java @@ -98,7 +98,7 @@ private static final class SyncAvoid { * called. *

    * - * @return the unmodifiable and sorted list of available locales. + * @return the unmodifiable and sorted list of available locales */ public static List availableLocaleList() { return SyncAvoid.AVAILABLE_LOCALE_ULIST; @@ -116,7 +116,7 @@ private static List availableLocaleList(final Predicate predicat * called. *

    * - * @return the unmodifiable set of available locales. + * @return the unmodifiable set of available locales */ public static Set availableLocaleSet() { return SyncAvoid.AVAILABLE_LOCALE_USET; @@ -129,8 +129,8 @@ public static Set availableLocaleSet() { * This method takes a language code and searches to find the countries available for that language. Variant locales are removed. *

    * - * @param languageCode the 2 letter language code, null returns empty. - * @return an unmodifiable List of Locale objects, not null. + * @param languageCode the 2 letter language code, null returns empty + * @return an unmodifiable List of Locale objects, not null */ public static List countriesByLanguage(final String languageCode) { if (languageCode == null) { @@ -143,8 +143,8 @@ public static List countriesByLanguage(final String languageCode) { /** * Tests whether the given Locale defines a variant. * - * @param locale The Locale to test. - * @return whether the given Locale defines a variant. + * @param locale the Locale to test + * @return whether the given Locale defines a variant */ private static boolean hasCountry(final Locale locale) { return locale.getCountry().isEmpty(); @@ -153,8 +153,8 @@ private static boolean hasCountry(final Locale locale) { /** * Tests whether the given Locale defines a country. * - * @param locale The Locale to test. - * @return whether the given Locale defines a country. + * @param locale the Locale to test + * @return whether the given Locale defines a country */ private static boolean hasVariant(final Locale locale) { return locale.getVariant().isEmpty(); @@ -163,8 +163,8 @@ private static boolean hasVariant(final Locale locale) { /** * Tests whether the given string is the length of an ISO 3166 alpha-2 country code. * - * @param str The string to test. - * @return whether the given string is the length of an ISO 3166 alpha-2 country code. + * @param str the string to test + * @return whether the given string is the length of an ISO 3166 alpha-2 country code */ private static boolean isAlpha2Len(final String str) { return str.length() == 2; @@ -173,8 +173,8 @@ private static boolean isAlpha2Len(final String str) { /** * Tests whether the given string is the length of an ISO 3166 alpha-3 country code. * - * @param str The string to test. - * @return whether the given string is the length of an ISO 3166 alpha-3 country code. + * @param str the string to test + * @return whether the given string is the length of an ISO 3166 alpha-3 country code */ private static boolean isAlpha3Len(final String str) { return str.length() == 3; @@ -183,8 +183,8 @@ private static boolean isAlpha3Len(final String str) { /** * Checks if the locale specified is in the set of available locales. * - * @param locale the Locale object to check if it is available. - * @return true if the locale is a known locale. + * @param locale the Locale object to check if it is available + * @return true if the locale is a known locale */ public static boolean isAvailableLocale(final Locale locale) { return availableLocaleSet().contains(locale); @@ -193,8 +193,8 @@ public static boolean isAvailableLocale(final Locale locale) { /** * Tests whether the given String is a ISO 3166 alpha-2 country code. * - * @param str the String to check. - * @return true, is the given String is a ISO 3166 compliant country code. + * @param str the String to check + * @return true, is the given String is a ISO 3166 compliant country code */ private static boolean isISO3166CountryCode(final String str) { return StringUtils.isAllUpperCase(str) && isAlpha2Len(str); @@ -203,8 +203,8 @@ private static boolean isISO3166CountryCode(final String str) { /** * Tests whether the given String is a ISO 639 compliant language code. * - * @param str the String to check. - * @return true, if the given String is a ISO 639 compliant language code. + * @param str the String to check + * @return true, if the given String is a ISO 639 compliant language code */ private static boolean isISO639LanguageCode(final String str) { return StringUtils.isAllLowerCase(str) && (isAlpha2Len(str) || isAlpha3Len(str)); @@ -217,8 +217,8 @@ private static boolean isISO639LanguageCode(final String str) { * equal to {@code "und"}. *

    * - * @param locale the locale to test. - * @return whether a Locale's language is undetermined. + * @param locale the locale to test + * @return whether a Locale's language is undetermined * @see Locale#toLanguageTag() * @since 3.14.0 */ @@ -229,8 +229,8 @@ public static boolean isLanguageUndetermined(final Locale locale) { /** * TestsNo whether the given String is a UN M.49 numeric area code. * - * @param str the String to check. - * @return true, is the given String is a UN M.49 numeric area code. + * @param str the String to check + * @return true, is the given String is a UN M.49 numeric area code */ private static boolean isNumericAreaCode(final String str) { return StringUtils.isNumeric(str) && isAlpha3Len(str); @@ -243,8 +243,8 @@ private static boolean isNumericAreaCode(final String str) { * This method takes a country code and searches to find the languages available for that country. Variant locales are removed. *

    * - * @param countryCode the 2-letter country code, null returns empty. - * @return an unmodifiable List of Locale objects, not null. + * @param countryCode the 2-letter country code, null returns empty + * @return an unmodifiable List of Locale objects, not null */ public static List languagesByCountry(final String countryCode) { if (countryCode == null) { @@ -262,8 +262,8 @@ public static List languagesByCountry(final String countryCode) { * = [Locale("fr", "CA", "xxx"), Locale("fr", "CA"), Locale("fr")] * * - * @param locale the locale to start from. - * @return the unmodifiable list of Locale objects, 0 being locale, not null. + * @param locale the locale to start from + * @return the unmodifiable list of Locale objects, 0 being locale, not null */ public static List localeLookupList(final Locale locale) { return localeLookupList(locale, locale); @@ -282,9 +282,9 @@ public static List localeLookupList(final Locale locale) { * contain the same locale twice. *

    * - * @param locale the locale to start from, null returns empty list. - * @param defaultLocale the default locale to use if no other is found. - * @return the unmodifiable list of Locale objects, 0 being locale, not null. + * @param locale the locale to start from, null returns empty list + * @param defaultLocale the default locale to use if no other is found + * @return the unmodifiable list of Locale objects, 0 being locale, not null */ public static List localeLookupList(final Locale locale, final Locale defaultLocale) { final List list = new ArrayList<>(4); @@ -306,10 +306,10 @@ public static List localeLookupList(final Locale locale, final Locale de /** * Creates new {@linkplain Locale} for the given country. * - * @param country An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code. See the {@linkplain Locale} class description about valid country + * @param country an ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code. See the {@linkplain Locale} class description about valid country * values. - * @throws NullPointerException thrown if either argument is null. - * @return a new new Locale for the given country. + * @return a new new Locale for the given country + * @throws NullPointerException thrown if either argument is null * @see Locale#Locale(String, String) */ static Locale ofCountry(final String country) { @@ -322,9 +322,9 @@ static Locale ofCountry(final String country) { * See {@link Locale} for the format. *

    * - * @param str the String to parse as a Locale. - * @return a Locale parsed from the given String. - * @throws IllegalArgumentException if the given String cannot be parsed. + * @param str the String to parse as a Locale + * @return a Locale parsed from the given String + * @throws IllegalArgumentException if the given String cannot be parsed * @see Locale */ private static Locale parseLocale(final String str) { @@ -356,8 +356,8 @@ private static Locale parseLocale(final String str) { /** * Returns the given locale if non-{@code null}, otherwise {@link Locale#getDefault()}. * - * @param locale a locale or {@code null}. - * @return the given locale if non-{@code null}, otherwise {@link Locale#getDefault()}. + * @param locale a locale or {@code null} + * @return the given locale if non-{@code null}, otherwise {@link Locale#getDefault()} * @since 3.12.0 */ public static Locale toLocale(final Locale locale) { @@ -391,9 +391,9 @@ public static Locale toLocale(final Locale locale) { * a dash. The length must be correct. *

    * - * @param str the locale String to convert, null returns null. - * @return a Locale, null if null input. - * @throws IllegalArgumentException if the string is an invalid format. + * @param str the locale String to convert, null returns null + * @return a Locale, null if null input + * @throws IllegalArgumentException if the string is an invalid format * @see Locale#forLanguageTag(String) * @see Locale#getISOCountries() */ diff --git a/src/main/java/org/apache/commons/lang3/LongRange.java b/src/main/java/org/apache/commons/lang3/LongRange.java index 88f3ee535dd..5928437729b 100644 --- a/src/main/java/org/apache/commons/lang3/LongRange.java +++ b/src/main/java/org/apache/commons/lang3/LongRange.java @@ -43,9 +43,9 @@ public final class LongRange extends NumberRange { * The arguments may be passed in the order (min, max) or (max,min). The getMinimum and getMaximum methods will return the correct values. *

    * - * @param fromInclusive the first value that defines the edge of the range, inclusive. - * @param toInclusive the second value that defines the edge of the range, inclusive. - * @return the range object, not null. + * @param fromInclusive the first value that defines the edge of the range, inclusive + * @param toInclusive the second value that defines the edge of the range, inclusive + * @return the range object, not null */ public static LongRange of(final long fromInclusive, final long toInclusive) { return of(Long.valueOf(fromInclusive), Long.valueOf(toInclusive)); @@ -62,10 +62,10 @@ public static LongRange of(final long fromInclusive, final long toInclusive) { * The arguments may be passed in the order (min, max) or (max,min). The getMinimum and getMaximum methods will return the correct values. *

    * - * @param fromInclusive the first value that defines the edge of the range, inclusive. - * @param toInclusive the second value that defines the edge of the range, inclusive. - * @return the range object, not null. - * @throws NullPointerException if either element is null. + * @param fromInclusive the first value that defines the edge of the range, inclusive + * @param toInclusive the second value that defines the edge of the range, inclusive + * @return the range object, not null + * @throws NullPointerException if either element is null */ public static LongRange of(final Long fromInclusive, final Long toInclusive) { return new LongRange(fromInclusive, toInclusive); @@ -74,10 +74,10 @@ public static LongRange of(final Long fromInclusive, final Long toInclusive) { /** * Creates a new instance. * - * @param number1 the first element, not null. - * @param number2 the second element, not null. - * @throws NullPointerException when element1 is null. - * @throws NullPointerException when element2 is null. + * @param number1 the first element, not null + * @param number2 the second element, not null + * @throws NullPointerException when element1 is null + * @throws NullPointerException when element2 is null */ private LongRange(final Long number1, final Long number2) { super(number1, number2, null); @@ -100,8 +100,8 @@ private LongRange(final Long number1, final Long number2) { * range.fit(99) --> 64 * } * - * @param element the element to test. - * @return the minimum, the element, or the maximum depending on the element's location relative to the range. + * @param element the element to test + * @return the minimum, the element, or the maximum depending on the element's location relative to the range * @since 3.19.0 */ public long fit(final long element) { diff --git a/src/main/java/org/apache/commons/lang3/NumberRange.java b/src/main/java/org/apache/commons/lang3/NumberRange.java index 908c9c078c8..bea9c734123 100644 --- a/src/main/java/org/apache/commons/lang3/NumberRange.java +++ b/src/main/java/org/apache/commons/lang3/NumberRange.java @@ -25,7 +25,7 @@ * We only offer specializations for Integer, Long, and Double (like Java Streams). *

    * - * @param The Number class. + * @param the Number class * @since 3.13.0 */ public class NumberRange extends Range { @@ -35,11 +35,11 @@ public class NumberRange extends Range { /** * Creates an instance. * - * @param number1 the first element, not null. - * @param number2 the second element, not null. - * @param comp the comparator to be used, null for natural ordering. - * @throws NullPointerException when element1 is null. - * @throws NullPointerException when element2 is null. + * @param number1 the first element, not null + * @param number2 the second element, not null + * @param comp the comparator to be used, null for natural ordering + * @throws NullPointerException when element1 is null + * @throws NullPointerException when element2 is null */ public NumberRange(final N number1, final N number2, final Comparator comp) { super(number1, number2, comp); diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java b/src/main/java/org/apache/commons/lang3/ObjectUtils.java index d07feb2a478..aa6ccb57967 100644 --- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java +++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java @@ -77,7 +77,7 @@ public class ObjectUtils { public static class Null implements Serializable { /** - * Required for serialization support. Declare serialization compatibility with Commons Lang 1.0 + * Required for serialization support. Declare serialization compatibility with Commons Lang 1.0. * * @see java.io.Serializable */ @@ -92,7 +92,7 @@ public static class Null implements Serializable { /** * Ensures singleton after serialization. * - * @return the singleton value. + * @return the singleton value */ private Object readResolve() { return NULL; @@ -137,9 +137,9 @@ private Object readResolve() { * ObjectUtils.allNotNull(*, *, null, *) = false * * - * @param values the values to test, may be {@code null} or empty. + * @param values the values to test, may be {@code null} or empty * @return {@code false} if there is at least one {@code null} value in the array or the array is {@code null}, {@code true} if all values in the array are - * not {@code null}s or array contains no elements. + * not {@code null}s or array contains no elements * @since 3.5 */ public static boolean allNotNull(final Object... values) { @@ -162,8 +162,8 @@ public static boolean allNotNull(final Object... values) { * ObjectUtils.allNull(null, null) = true * * - * @param values the values to test, may be {@code null} or empty. - * @return {@code true} if all values in the array are {@code null}s, {@code false} if there is at least one non-null value in the array. + * @param values the values to test, may be {@code null} or empty + * @return {@code true} if all values in the array are {@code null}s, {@code false} if there is at least one non-null value in the array * @since 3.11 */ public static boolean allNull(final Object... values) { @@ -186,7 +186,7 @@ public static boolean allNull(final Object... values) { * ObjectUtils.anyNotNull(null, null) = false * * - * @param values the values to test, may be {@code null} or empty. + * @param values the values to test, may be {@code null} or empty * @return {@code true} if there is at least one non-null value in the array, {@code false} if all values in the array are {@code null}s. If the array is * {@code null} or empty {@code false} is also returned. * @since 3.5 @@ -212,7 +212,7 @@ public static boolean anyNotNull(final Object... values) { * ObjectUtils.anyNull(*, *, null, *) = true * * - * @param values the values to test, may be {@code null} or empty. + * @param values the values to test, may be {@code null} or empty * @return {@code true} if there is at least one {@code null} value in the array, {@code false} if all the values are non-null. If the array is {@code null} * or empty, {@code true} is also returned. * @since 3.11 @@ -224,10 +224,10 @@ public static boolean anyNull(final Object... values) { /** * Clones an object. * - * @param the type of the object. - * @param obj the object to clone, null returns null. - * @return the clone if the object implements {@link Cloneable} otherwise {@code null}. - * @throws CloneFailedException if the object is cloneable and the clone operation fails. + * @param the type of the object + * @param obj the object to clone, null returns null + * @return the clone if the object implements {@link Cloneable} otherwise {@code null} + * @throws CloneFailedException if the object is cloneable and the clone operation fails * @since 3.0 */ public static T clone(final T obj) { @@ -267,10 +267,10 @@ public static T clone(final T obj) { * have to change. *

    * - * @param the type of the object. - * @param obj the object to clone, null returns null. - * @return the clone if the object implements {@link Cloneable} otherwise the object itself. - * @throws CloneFailedException if the object is cloneable and the clone operation fails. + * @param the type of the object + * @param obj the object to clone, null returns null + * @return the clone if the object implements {@link Cloneable} otherwise the object itself + * @throws CloneFailedException if the object is cloneable and the clone operation fails * @since 3.0 */ public static T cloneIfPossible(final T obj) { @@ -284,10 +284,10 @@ public static T cloneIfPossible(final T obj) { * TODO Move to ComparableUtils. *

    * - * @param type of the values processed by this method. - * @param c1 the first comparable, may be null. - * @param c2 the second comparable, may be null. - * @return a negative value if c1 < c2, zero if c1 = c2 and a positive value if c1 > c2. + * @param type of the values processed by this method + * @param c1 the first comparable, may be null + * @param c2 the second comparable, may be null + * @return a negative value if c1 < c2, zero if c1 = c2 and a positive value if c1 > c2 */ public static > int compare(final T c1, final T c2) { return compare(c1, c2, false); @@ -299,12 +299,12 @@ public static > int compare(final T c1, final T * TODO Move to ComparableUtils. *

    * - * @param type of the values processed by this method. - * @param c1 the first comparable, may be null. - * @param c2 the second comparable, may be null. + * @param type of the values processed by this method + * @param c1 the first comparable, may be null + * @param c2 the second comparable, may be null * @param nullGreater if true {@code null} is considered greater than a non-{@code null} value or if false {@code null} is considered less than a - * Non-{@code null} value. - * @return a negative value if c1 < c2, zero if c1 = c2 and a positive value if c1 > c2. + * Non-{@code null} value + * @return a negative value if c1 < c2, zero if c1 = c2 and a positive value if c1 > c2 * @see java.util.Comparator#compare(Object, Object) */ public static > int compare(final T c1, final T c2, final boolean nullGreater) { @@ -329,8 +329,8 @@ public static > int compare(final T c1, final T * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the boolean value to return. - * @return the boolean v, unchanged. + * @param v the boolean value to return + * @return the boolean v, unchanged * @since 3.2 */ public static boolean CONST(final boolean v) { @@ -346,8 +346,8 @@ public static boolean CONST(final boolean v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the byte value to return. - * @return the byte v, unchanged. + * @param v the byte value to return + * @return the byte v, unchanged * @since 3.2 */ public static byte CONST(final byte v) { @@ -363,8 +363,8 @@ public static byte CONST(final byte v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the char value to return. - * @return the char v, unchanged. + * @param v the char value to return + * @return the char v, unchanged * @since 3.2 */ public static char CONST(final char v) { @@ -380,8 +380,8 @@ public static char CONST(final char v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the double value to return. - * @return the double v, unchanged. + * @param v the double value to return + * @return the double v, unchanged * @since 3.2 */ public static double CONST(final double v) { @@ -397,8 +397,8 @@ public static double CONST(final double v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the float value to return. - * @return the float v, unchanged. + * @param v the float value to return + * @return the float v, unchanged * @since 3.2 */ public static float CONST(final float v) { @@ -414,8 +414,8 @@ public static float CONST(final float v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the int value to return. - * @return the int v, unchanged. + * @param v the int value to return + * @return the int v, unchanged * @since 3.2 */ public static int CONST(final int v) { @@ -431,8 +431,8 @@ public static int CONST(final int v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the long value to return. - * @return the long v, unchanged. + * @param v the long value to return + * @return the long v, unchanged * @since 3.2 */ public static long CONST(final long v) { @@ -448,8 +448,8 @@ public static long CONST(final long v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the short value to return. - * @return the short v, unchanged. + * @param v the short value to return + * @return the short v, unchanged * @since 3.2 */ public static short CONST(final short v) { @@ -465,9 +465,9 @@ public static short CONST(final short v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param the Object type. - * @param v the genericized Object value to return (typically a String). - * @return the genericized Object v, unchanged (typically a String). + * @param the Object type + * @param v the genericized Object value to return (typically a String) + * @return the genericized Object v, unchanged (typically a String) * @since 3.2 */ public static T CONST(final T v) { @@ -483,9 +483,9 @@ public static T CONST(final T v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the byte literal (as an int) value to return. - * @throws IllegalArgumentException if the value passed to v is larger than a byte, that is, smaller than -128 or larger than 127. - * @return the byte v, unchanged. + * @param v the byte literal (as an int) value to return + * @return the byte v, unchanged + * @throws IllegalArgumentException if the value passed to v is larger than a byte, that is, smaller than -128 or larger than 127 * @since 3.2 */ public static byte CONST_BYTE(final int v) { @@ -504,9 +504,9 @@ public static byte CONST_BYTE(final int v) { * * This way any jars that refer to this field do not have to recompile themselves if the field's value changes at some future date. * - * @param v the short literal (as an int) value to return. - * @throws IllegalArgumentException if the value passed to v is larger than a short, that is, smaller than -32768 or larger than 32767. - * @return the byte v, unchanged. + * @param v the short literal (as an int) value to return + * @return the byte v, unchanged + * @throws IllegalArgumentException if the value passed to v is larger than a short, that is, smaller than -32768 or larger than 32767 * @since 3.2 */ public static short CONST_SHORT(final int v) { @@ -527,10 +527,10 @@ public static short CONST_SHORT(final int v) { * ObjectUtils.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE * * - * @param the type of the object. - * @param object the {@link Object} to test, may be {@code null}. - * @param defaultValue the default value to return, may be {@code null}. - * @return {@code object} if it is not {@code null}, defaultValue otherwise. + * @param the type of the object + * @param object the {@link Object} to test, may be {@code null} + * @param defaultValue the default value to return, may be {@code null} + * @return {@code object} if it is not {@code null}, defaultValue otherwise * @see #getIfNull(Object, Object) * @see #getIfNull(Object, Supplier) * @deprecated Use {@link #getIfNull(Object, Object)}. @@ -555,9 +555,9 @@ public static T defaultIfNull(final T object, final T defaultValue) { * ObjectUtils.equals(Boolean.TRUE, Boolean.FALSE) = false * * - * @param object1 the first object, may be {@code null}. - * @param object2 the second object, may be {@code null}. - * @return {@code true} if the values of both objects are the same. + * @param object1 the first object, may be {@code null} + * @param object2 the second object, may be {@code null} + * @return {@code true} if the values of both objects are the same * @deprecated Replaced by {@code java.util.Objects.equals(Object, Object)} in Java 7 and will * be removed from future releases. */ @@ -582,10 +582,10 @@ public static boolean equals(final Object object1, final Object object2) { * ObjectUtils.firstNonNull() = null * * - * @param the component type of the array. - * @param values the values to test, may be {@code null} or empty. + * @param the component type of the array + * @param values the values to test, may be {@code null} or empty * @return the first value from {@code values} which is not {@code null}, - * or {@code null} if there are no non-null values. + * or {@code null} if there are no non-null values * @since 3.0 */ @SafeVarargs @@ -596,9 +596,9 @@ public static T firstNonNull(final T... values) { /** * Delegates to {@link Object#getClass()} using generics. * - * @param The argument type or null. - * @param object The argument. - * @return The argument's Class or null. + * @param the argument type or null + * @param object the argument + * @return the argument's Class or null * @since 3.13.0 */ @SuppressWarnings("unchecked") @@ -622,10 +622,10 @@ public static Class getClass(final T object) { * See also {@link Consumers#accept(Consumer, Object)} and {@link Suppliers#get(Supplier)}. *

    * - * @param the type of the return values. + * @param the type of the return values * @param suppliers the suppliers returning the values to test. {@code null} values are ignored. Suppliers may return {@code null} or a value of type * {@code T}. - * @return the first return value from {@code suppliers} which is not {@code null}, or {@code null} if there are no non-null values. + * @return the first return value from {@code suppliers} which is not {@code null}, or {@code null} if there are no non-null values * @see Consumers#accept(Consumer, Object) * @see Suppliers#get(Supplier) * @since 3.10 @@ -655,10 +655,10 @@ public static T getFirstNonNull(final Supplier... suppliers) { * See also {@link Consumers#accept(Consumer, Object)} and {@link Suppliers#get(Supplier)}. *

    * - * @param the type of the object. - * @param object the {@link Object} to test, may be {@code null}. - * @param defaultSupplier the default value to return, may be {@code null}. - * @return {@code object} if it is not {@code null}, {@code defaultValueSupplier.get()} otherwise. + * @param the type of the object + * @param object the {@link Object} to test, may be {@code null} + * @param defaultSupplier the default value to return, may be {@code null} + * @return {@code object} if it is not {@code null}, {@code defaultValueSupplier.get()} otherwise * @see #getIfNull(Object, Object) * @see Consumers#accept(Consumer, Object) * @see Suppliers#get(Supplier) @@ -682,10 +682,10 @@ public static T getIfNull(final T object, final Supplier defaultSupplier) * See also {@link Consumers#accept(Consumer, Object)} and {@link Suppliers#get(Supplier)}. *

    * - * @param the type of the object. - * @param object the {@link Object} to test, may be {@code null}. - * @param defaultValue the default value to return, may be {@code null}. - * @return {@code object} if it is not {@code null}, defaultValue otherwise. + * @param the type of the object + * @param object the {@link Object} to test, may be {@code null} + * @param defaultValue the default value to return, may be {@code null} + * @return {@code object} if it is not {@code null}, defaultValue otherwise * @see #getIfNull(Object, Supplier) * @see Consumers#accept(Consumer, Object) * @see Suppliers#get(Supplier) @@ -703,8 +703,8 @@ public static T getIfNull(final T object, final T defaultValue) { * ObjectUtils.hashCode(obj) = obj.hashCode() * * - * @param obj the object to obtain the hash code of, may be {@code null}. - * @return the hash code of the object, or zero if null. + * @param obj the object to obtain the hash code of, may be {@code null} + * @return the hash code of the object, or zero if null * @since 2.1 * @deprecated Replaced by {@code java.util.Objects.hashCode(Object)} in Java 7 and will be removed in future releases. */ @@ -720,8 +720,8 @@ public static int hashCode(final Object obj) { * Short hand for {@code Integer.toHexString(Objects.hashCode(object))}. *

    * - * @param object object for which the hashCode is to be calculated. - * @return Hash code in hexadecimal format. + * @param object object for which the hashCode is to be calculated + * @return hash code in hexadecimal format * @since 3.13.0 */ public static String hashCodeHex(final Object object) { @@ -744,8 +744,8 @@ public static String hashCodeHex(final Object object) { * ObjectUtils.hashCodeMulti(a, b, c) = ((31 + a.hashCode()) * 31 + b.hashCode()) * 31 + c.hashCode() * * - * @param objects the objects to obtain the hash code of, may be {@code null}. - * @return the hash code of the objects, or zero if null. + * @param objects the objects to obtain the hash code of, may be {@code null} + * @return the hash code of the objects, or zero if null * @since 3.0 * @deprecated Replaced by {@code java.util.Objects.hash(Object...)} in Java 7 and will be removed in future releases. */ @@ -767,8 +767,8 @@ public static int hashCodeMulti(final Object... objects) { * Short hand for {@code Integer.toHexString(System.identityHashCode(object))}. *

    * - * @param object object for which the hashCode is to be calculated. - * @return Hash code in hexadecimal format. + * @param object object for which the hashCode is to be calculated + * @return hash code in hexadecimal format * @since 3.13.0 */ public static String identityHashCodeHex(final Object object) { @@ -786,9 +786,9 @@ public static String identityHashCodeHex(final Object object) { * ObjectUtils.identityToString(appendable, Boolean.TRUE) = appendable.append("java.lang.Boolean@7fa") * * - * @param appendable the appendable to append to. - * @param object the object to create a toString for. - * @throws IOException if an I/O error occurs. + * @param appendable the appendable to append to + * @param object the object to create a toString for + * @throws IOException if an I/O error occurs * @since 3.2 */ public static void identityToString(final Appendable appendable, final Object object) throws IOException { @@ -807,8 +807,8 @@ public static void identityToString(final Appendable appendable, final Object ob * ObjectUtils.identityToString(Boolean.TRUE) = "java.lang.Boolean@7fa" * * - * @param object the object to create a toString for, may be {@code null}. - * @return the default toString text, or {@code null} if {@code null} passed in. + * @param object the object to create a toString for, may be {@code null} + * @return the default toString text, or {@code null} if {@code null} passed in */ public static String identityToString(final Object object) { if (object == null) { @@ -836,8 +836,8 @@ public static String identityToString(final Object object) { * ObjectUtils.identityToString(builder, Boolean.TRUE) = builder.append("java.lang.Boolean@7fa") * * - * @param builder the builder to append to. - * @param object the object to create a toString for. + * @param builder the builder to append to + * @param object the object to create a toString for * @since 3.2 * @deprecated as of 3.6, because StrBuilder was moved to commons-text, * use one of the other {@code identityToString} methods instead. @@ -864,8 +864,8 @@ public static void identityToString(final StrBuilder builder, final Object objec * ObjectUtils.identityToString(buf, Boolean.TRUE) = buf.append("java.lang.Boolean@7fa") * * - * @param buffer the buffer to append to. - * @param object the object to create a toString for. + * @param buffer the buffer to append to + * @param object the object to create a toString for * @since 2.4 */ public static void identityToString(final StringBuffer buffer, final Object object) { @@ -889,8 +889,8 @@ public static void identityToString(final StringBuffer buffer, final Object obje * ObjectUtils.identityToString(builder, Boolean.TRUE) = builder.append("java.lang.Boolean@7fa") * * - * @param builder the builder to append to. - * @param object the object to create a toString for. + * @param builder the builder to append to + * @param object the object to create a toString for * @since 3.2 */ public static void identityToString(final StringBuilder builder, final Object object) { @@ -919,8 +919,8 @@ public static void identityToString(final StringBuilder builder, final Object ob * ObjectUtils.isArray(1234) = false * * - * @param object the object to check, may be {@code null}. - * @return {@code true} if the object is an {@code array}, {@code false} otherwise. + * @param object the object to check, may be {@code null} + * @return {@code true} if the object is an {@code array}, {@code false} otherwise * @since 3.13.0 */ public static boolean isArray(final Object object) { @@ -952,8 +952,8 @@ public static boolean isArray(final Object object) { * ObjectUtils.isEmpty(Optional.empty()) = true * * - * @param object the {@link Object} to test, may be {@code null}. - * @return {@code true} if the object has a supported type and is empty or null, {@code false} otherwise. + * @param object the {@link Object} to test, may be {@code null} + * @return {@code true} if the object has a supported type and is empty or null, {@code false} otherwise * @since 3.9 */ public static boolean isEmpty(final Object object) { @@ -1003,7 +1003,7 @@ public static boolean isEmpty(final Object object) { * ObjectUtils.isNotEmpty(Optional.empty()) = false * * - * @param object the {@link Object} to test, may be {@code null}. + * @param object the {@link Object} to test, may be {@code null} * @return {@code true} if the object has an unsupported type or is not empty. * and not null, {@code false} otherwise. * @since 3.9 @@ -1018,10 +1018,10 @@ public static boolean isNotEmpty(final Object object) { * TODO Move to ComparableUtils. *

    * - * @param type of the values processed by this method. - * @param values the set of comparable values, may be null. + * @param type of the values processed by this method + * @param values the set of comparable values, may be null * @return - *