io.bdeploy.common.util.CollectionHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
Public API including dependencies, ready to be used for integrations and plugins.
package io.bdeploy.common.util;
import java.util.List;
import java.util.function.Predicate;
public class CollectionHelper {
private CollectionHelper() {
// static helper.
}
/**
* Searches for the index of an element in the list by using a predicated.
*/
public static int indexOf(List list, Predicate match) {
for (int i = 0; i < list.size(); ++i) {
if (match.test(list.get(i))) {
return i;
}
}
return -1;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy