public class OptionalAdaptorUtils
extends java.lang.Object
Constructor and Description |
---|
OptionalAdaptorUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.Object,java.util.List<java.lang.reflect.Field>> |
getOptionalFields(java.lang.Object obj)
Retrieves any Optional fields in a given object hierarchy.
|
static boolean |
hasOptionalFields(java.lang.Object obj)
Determines if any Optional fields exist in a given object hierarchy.
|
static <T> T |
initializeAllNullOptionalFieldsAsEmpty(T obj)
Searches a given Object hierarchy and sets all null Optional fields to Optional.empty()
|
public static <T> T initializeAllNullOptionalFieldsAsEmpty(T obj)
T
- the given type of the given Object hierarchyobj
- an Object, Array, Iterable or Mappublic static boolean hasOptionalFields(java.lang.Object obj)
obj
- an Object, Array, Iterable or Mappublic static java.util.Map<java.lang.Object,java.util.List<java.lang.reflect.Field>> getOptionalFields(java.lang.Object obj)
obj
- an Object, Array, Iterable or Map