Class OCollections
java.lang.Object
com.orientechnologies.common.util.OCollections
Set of utility methods to work with collections.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> intindexOf(List<T> list, T object, Comparator<T> comparator) This method is used to find item in collection using passed in comparator.static StringCreate a string representation of all objects in the given Iterable. example : [value1,value2,value3]
-
Constructor Details
-
OCollections
public OCollections()
-
-
Method Details
-
indexOf
This method is used to find item in collection using passed in comparator. Only 0 value (requested object is found) returned by comparator is taken into account the rest is ignored.- Type Parameters:
T- Type of collection elements.- Parameters:
list- List in which value should be found.object- Object to find.comparator- Comparator is sued for search.- Returns:
- Index of found item or
-1otherwise.
-
toString
Create a string representation of all objects in the given Iterable. example : [value1,value2,value3]- Parameters:
iterable-- Returns:
- String
-