Class ParseUtil
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.utils.ParseUtil
-
public final class ParseUtil extends Object
Parser - Utility class for parsing using JAXB generated classes.
Copyright (c) 2003-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.- Author:
- Alexander Verbraeck
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TfindObject(List<?> objectList, Class<T> clazz, Predicate<T> predicate)Select object of given type by predicate.static <T> TfindObject(List<T> objectList, Predicate<T> predicate)Select object of given type by predicate.static <T> List<T>getObjectsOfType(List<?> objectList, Class<T> clazz)Returns all objects of given type from the list of all objects.
-
-
-
Method Detail
-
getObjectsOfType
public static <T> List<T> getObjectsOfType(List<?> objectList, Class<T> clazz)
Returns all objects of given type from the list of all objects.- Type Parameters:
T- type- Parameters:
objectList- List<?>; list of objectsclazz- Class<T>; class of type of objects to return- Returns:
- list of all objects of given type from the list of all objects
-
findObject
public static <T> T findObject(List<?> objectList, Class<T> clazz, Predicate<T> predicate)
Select object of given type by predicate.- Type Parameters:
T- type- Parameters:
objectList- List<?>; list of objectsclazz- Class<T>; class of type of objects to returnpredicate- Predicate<T>; predicate- Returns:
- (first) object of given type that matches the predicate
-
findObject
public static <T> T findObject(List<T> objectList, Predicate<T> predicate)
Select object of given type by predicate.- Type Parameters:
T- type- Parameters:
objectList- List<T>; list of objectspredicate- Predicate<T>; predicate- Returns:
- (first) object of given type that matches the predicate
-
-