The java com.liferay.portal.kernel.util GetterUtil is a utility class that can be used to retrieve values from objects, handling null values and converting them to the desired type. Some examples of methods available in the GetterUtil class are getBoolean, getDouble, getFloat, getInt, getLong, getObject, and getString.
For instance, the following code snippet shows how to use the getBoolean method to retrieve a value from a map and convert it to a boolean:
If the value retrieved from the map is null or not a boolean, the GetterUtil class will return a default value, which is false for boolean values.
Another example is the getObject method, which can be used to retrieve an object from an array or list and cast it to the desired type. Here is an example: