Interface CollectionAccessor
public interface CollectionAccessor
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> List<T>getPropertyValue(Collection<?> _objects, String _key) Iterates over all objects in the list, retrieves the value for the given key and stores it into a new list in the same order.
-
Method Details
-
getPropertyValue
Iterates over all objects in the list, retrieves the value for the given key and stores it into a new list in the same order. This method is slightly faster than using getPropertyValue, which of course can also be used for simple keys.Example:
List projectIds = valuesForKeys(projects, "logID");
The returned List should be considered immutable.
- Parameters:
_objects- the objects to retrieve the values from_key- the key of the values to be retrieved- Returns:
- a list containing the values for the given key
- See Also:
-
getPropertyValue()
-