Module org.htmlunit

Class ArrayUtils

java.lang.Object
org.htmlunit.util.ArrayUtils

public final class ArrayUtils extends Object
Utility functions not covered by third party libraries.
Author:
Ronald Brill
  • Field Details

    • EMPTY_BYTE_ARRAY

      public static final byte[] EMPTY_BYTE_ARRAY
      An empty immutable byte array.
    • EMPTY_CHAR_ARRAY

      public static final char[] EMPTY_CHAR_ARRAY
      An empty immutable char array.
    • EMPTY_STRING_ARRAY

      public static final String[] EMPTY_STRING_ARRAY
      An empty immutable String array.
  • Method Details

    • contains

      public static boolean contains(String[] strings, String expected)
      Parameters:
      strings - the string[] to check
      expected - the string that we expect
      Returns:
      true if at least one element of the array equals to the expected string
    • contains

      public static boolean contains(char[] chars, char expected)
      Parameters:
      chars - the char[] to check
      expected - the char that we expect
      Returns:
      true if at least one element of the array equals to the expected char
    • contains

      public static boolean contains(byte[] bytes, byte expected)
      Parameters:
      bytes - the byte[] to check
      expected - the byte that we expect
      Returns:
      true if at least one element of the array equals to the expected byte
    • containsIgnoreCase

      public static boolean containsIgnoreCase(String[] strings, String expected)
      Parameters:
      strings - the string[] to check
      expected - the string that we expect
      Returns:
      true if at least one element of the array equalsIgnoreCase to the expected string