private Map < String , Field > flattenEntireRecord ( Field rootField ) { Map < String , Field > ret = new LinkedHashMap <> ( ) ; switch ( rootField . getType ( ) ) { case MAP : case LIST_MAP : flattenMap ( "" , rootField . getValueAsMap ( ) , ret ) ; break ; case LIST : flattenList ( "" , rootField . getValueAsList ( ) , ret ) ; break ; default : break ; } return ret ; }
Flatten the entire record to one giant map