java.lang.Object
org.htmlunit.util.ArrayUtils
Utility functions not covered by third-party libraries.
- Author:
- Ronald Brill
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(byte[] bytes, byte expected) Returns whether at least one element of the given array equals the expected byte.static booleancontains(char[] chars, char expected) Returns whether at least one element of the given array equals the expected char.static booleanReturns whether at least one element of the given array equals the expected string.static booleancontainsIgnoreCase(String[] strings, String expected) Returns whether at least one element of the given array equals the expected string, ignoring case.
-
Field Details
-
EMPTY_BYTE_ARRAY
public static final byte[] EMPTY_BYTE_ARRAYAn empty immutablebytearray. -
EMPTY_CHAR_ARRAY
public static final char[] EMPTY_CHAR_ARRAYAn empty immutablechararray. -
EMPTY_STRING_ARRAY
An empty immutableStringarray.
-
-
Method Details
-
contains
Returns whether at least one element of the given array equals the expected string.- Parameters:
strings- the string array to checkexpected- the string to search for- Returns:
trueif at least one element equals the expected string
-
contains
public static boolean contains(char[] chars, char expected) Returns whether at least one element of the given array equals the expected char.- Parameters:
chars- the char array to checkexpected- the char to search for- Returns:
trueif at least one element equals the expected char
-
contains
public static boolean contains(byte[] bytes, byte expected) Returns whether at least one element of the given array equals the expected byte.- Parameters:
bytes- the byte array to checkexpected- the byte to search for- Returns:
trueif at least one element equals the expected byte
-
containsIgnoreCase
Returns whether at least one element of the given array equals the expected string, ignoring case.- Parameters:
strings- the string array to checkexpected- the string to search for- Returns:
trueif at least one element equals the expected string, ignoring case
-