Makes listContains and concatenate functions public
This commit is contained in:
parent
40a2f58712
commit
8ffd4184d3
@ -21,7 +21,7 @@ public final class ListUtil {
|
|||||||
* @param <T> <p>The type of the two lists.</p>
|
* @param <T> <p>The type of the two lists.</p>
|
||||||
* @return <p>A new array containing all elements from the two arrays.</p>
|
* @return <p>A new array containing all elements from the two arrays.</p>
|
||||||
*/
|
*/
|
||||||
static <T> T[] concatenate(T[] listA, T[] listB) {
|
public static <T> T[] concatenate(T[] listA, T[] listB) {
|
||||||
int listALength = listA.length;
|
int listALength = listA.length;
|
||||||
int listBLength = listB.length;
|
int listBLength = listB.length;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@ -53,7 +53,7 @@ public final class ListUtil {
|
|||||||
* @param <T> Anything which can be stored in a list
|
* @param <T> Anything which can be stored in a list
|
||||||
* @return True if at least one element fulfills the predicate
|
* @return True if at least one element fulfills the predicate
|
||||||
*/
|
*/
|
||||||
static <T> boolean listContains(T[] list, Predicate<T> predicate) {
|
public static <T> boolean listContains(T[] list, Predicate<T> predicate) {
|
||||||
for (T item : list) {
|
for (T item : list) {
|
||||||
if (predicate.test(item)) {
|
if (predicate.test(item)) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user