Class OCollections

java.lang.Object
com.orientechnologies.common.util.OCollections

public class OCollections extends Object
Set of utility methods to work with collections.
  • Constructor Details

    • OCollections

      public OCollections()
  • Method Details

    • indexOf

      public static <T> int indexOf(List<T> list, T object, Comparator<T> comparator)
      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 -1 otherwise.
    • toString

      public static String toString(Iterable<?> iterable)
      Create a string representation of all objects in the given Iterable. example : [value1,value2,value3]
      Parameters:
      iterable -
      Returns:
      String