private Map < UUID , FieldType > populateCustomFieldMap ( ) { byte [ ] data = m_taskProps . getByteArray ( Props . CUSTOM_FIELDS ) ; int length = MPPUtility . getInt ( data , 0 ) ; int index = length + 36 ; // 4 byte record count int recordCount = MPPUtility . getInt ( data , index ) ; index += 4 ; // 8 bytes per record index += ( 8 * recordCount ) ; Map < UUID , FieldType > map = new HashMap < UUID , FieldType > ( ) ; while ( index < data . length ) { int blockLength = MPPUtility . getInt ( data , index ) ; if ( blockLength <= 0 || index + blockLength > data . length ) { break ; } int fieldID = MPPUtility . getInt ( data , index + 4 ) ; FieldType field = FieldTypeHelper . getInstance ( fieldID ) ; UUID guid = MPPUtility . getGUID ( data , index + 160 ) ; map . put ( guid , field ) ; index += blockLength ; } return map ; }
Generate a map of UUID values to field types .