public static Map < String , FieldAccess > getFieldsFromObject ( Object object ) { try { Map < String , FieldAccess > fields ; if ( object instanceof Map ) { fields = getFieldsFromMap ( ( Map < String , Object > ) object ) ; } else { fields = getPropertyFieldAccessMap ( object . getClass ( ) ) ; } return fields ; } catch ( Exception ex ) { requireNonNull ( object , "Item cannot be null" ) ; return handle ( Map . class , ex , "Unable to get fields from object" , className ( object ) ) ; } }
Get fields from object or Map . Allows maps to act like they have fields .