private Object deserializeKeyAsColumn ( String fieldName , byte [ ] family , String prefix , Result result ) { // Construct a map of keyAsColumn field values. From this we'll be able // to use the entityComposer to construct the entity field value. byte [ ] prefixBytes = prefix != null ? prefix . getBytes ( ) : null ; Map < CharSequence , Object > fieldValueAsMap = new HashMap < CharSequence , Object > ( ) ; Map < byte [ ] , byte [ ] > familyMap = result . getFamilyMap ( family ) ; for ( Map . Entry < byte [ ] , byte [ ] > entry : familyMap . entrySet ( ) ) { byte [ ] qualifier = entry . getKey ( ) ; // if the qualifier of this column has a prefix that matches the // field prefix, then remove the prefix from the qualifier. if ( prefixBytes != null && qualifier . length > prefixBytes . length && Arrays . equals ( Arrays . copyOf ( qualifier , prefixBytes . length ) , prefixBytes ) ) { qualifier = Arrays . copyOfRange ( qualifier , prefixBytes . length , qualifier . length ) ; } byte [ ] columnBytes = entry . getValue ( ) ; CharSequence keyAsColumnKey = deserializeKeyAsColumnKeyFromBytes ( fieldName , qualifier ) ; Object keyAsColumnValue = deserializeKeyAsColumnValueFromBytes ( fieldName , qualifier , columnBytes ) ; fieldValueAsMap . put ( keyAsColumnKey , keyAsColumnValue ) ; } // Now build the entity field from the fieldValueAsMap. return entityComposer . buildKeyAsColumnField ( fieldName , fieldValueAsMap ) ; }
Deserialize the entity field that has a keyAsColumn mapping .