Package de.eldoria.eldoutilities.utils
Class ArrayUtil
java.lang.Object
de.eldoria.eldoutilities.utils.ArrayUtil
This class containts methods to handle arrays and search.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanarrayContains(char[] chars, char... values) Checks if a array contains any of the values.static booleanarrayContains(String[] strings, String... values) Checks if a array contains any of the values.static <T> T[]combineArrays(Class<T> clazz, T[] array, T[]... arrays) Combines two or more arrays.static String[]combineArrays(String[] array, String[]... arrays) Combines two or more arrays.static booleanendingWithInArray(String value, String[] array) Checks if a string ends with a value in a arraystatic MatcherfindInArray(String[] strings, Pattern contains) Checks if a string in a array matches a pattern.startingWithInArray(String value, String[] array) Searches for strings, which are starting with the provided valuestatic booleanstringStartingWithValueInArray(String value, String[] array) Checks if a string start with any value in a string.
-
Method Details
-
findInArray
Checks if a string in a array matches a pattern.- Parameters:
strings- strings to checkcontains- pattern to check against- Returns:
- matcher instance wich matches the string
-
arrayContains
Checks if a array contains any of the values.- Parameters:
strings- string to checkvalues- one or more value to check agains- Returns:
- true if a match was found
-
arrayContains
public static boolean arrayContains(char[] chars, char... values) Checks if a array contains any of the values.- Parameters:
chars- chars to checkvalues- one or more value to check agains- Returns:
- true if a match was found
-
combineArrays
Combines two or more arrays.- Parameters:
array- array to combinearrays- arrays to combine- Returns:
- one array
-
combineArrays
Combines two or more arrays.- Type Parameters:
T- type of array- Parameters:
array- array to combinearrays- arrays to combineclazz- clazz of array- Returns:
- one array
-
startingWithInArray
Searches for strings, which are starting with the provided value- Parameters:
value- start to search forarray- array to check- Returns:
- list of strings which starts with the provided value
-
stringStartingWithValueInArray
Checks if a string start with any value in a string.- Parameters:
value- value to checkarray- array values.- Returns:
- true if the value starts with any value in the array
-
endingWithInArray
Checks if a string ends with a value in a array- Parameters:
value- value to checkarray- array values.- Returns:
- true if the value ends with any value in the array
-