Package ca.uhn.fhir.util
Class ObjectUtil
java.lang.Object
ca.uhn.fhir.util.ObjectUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional
<T> castIfInstanceof
(Object theObject, Class<T> theClass) Cast the object to the type using Optional.static boolean
Deprecated.Just use Objects.equals() instead;static <T> T
requireNonNull
(T obj, String message) static void
requireNotEmpty
(String str, String message)
-
Method Details
-
equals
Deprecated.Just use Objects.equals() instead; -
requireNonNull
-
requireNotEmpty
-
castIfInstanceof
Cast the object to the type using Optional. Useful for streaming with flatMap.- Parameters:
theObject
- any objecttheClass
- the class to check instanceof- Returns:
- Optional present if theObject is of type theClass
-