Class ObjectUtil

java.lang.Object
ca.uhn.fhir.util.ObjectUtil

public class ObjectUtil extends Object
  • Method Details

    • equals

      @Deprecated(since="6.2") public static boolean equals(Object object1, Object object2)
      Deprecated.
      Just use Objects.equals() instead;
    • requireNonNull

      public static <T> T requireNonNull(T obj, String message)
    • requireNotEmpty

      public static void requireNotEmpty(String str, String message)
    • castIfInstanceof

      public static <T> Optional<T> castIfInstanceof(Object theObject, Class<T> theClass)
      Cast the object to the type using Optional. Useful for streaming with flatMap.
      Parameters:
      theObject - any object
      theClass - the class to check instanceof
      Returns:
      Optional present if theObject is of type theClass