public static QueryEntity readQueryEntity(BinaryRawReader in){
  QueryEntity res=new QueryEntity();
  res.setKeyType(in.readString());
  res.setValueType(in.readString());
  int cnt=in.readInt();
  if (cnt > 0) {
    LinkedHashMap<String,String> fields=new LinkedHashMap<>(cnt);
    for (int i=0; i < cnt; i++)     fields.put(in.readString(),in.readString());
    res.setFields(fields);
  }
  cnt=in.readInt();
  if (cnt > 0) {
    Map<String,String> aliases=new HashMap<>(cnt);
    for (int i=0; i < cnt; i++)     aliases.put(in.readString(),in.readString());
    res.setAliases(aliases);
  }
  cnt=in.readInt();
  if (cnt > 0) {
    Collection<QueryIndex> indexes=new ArrayList<>(cnt);
    for (int i=0; i < cnt; i++)     indexes.add(readQueryIndex(in));
    res.setIndexes(indexes);
  }
  return res;
}

public static QueryEntity readQueryEntity ( BinaryRawReader in ) { QueryEntity res = new QueryEntity ( ) ; res . setKeyType ( in . readString ( ) ) ; res . setValueType ( in . readString ( ) ) ; int cnt = in . readInt ( ) ; if ( cnt > 0 ) { LinkedHashMap < String , String > fields = new LinkedHashMap < > ( cnt ) ; for ( int i = 0 ; i < cnt ; i ++ ) fields . put ( in . readString ( ) , in . readString ( ) ) ; res . setFields ( fields ) ; } cnt = in . readInt ( ) ; if ( cnt > 0 ) { Map < String , String > aliases = new HashMap < > ( cnt ) ; for ( int i = 0 ; i < cnt ; i ++ ) aliases . put ( in . readString ( ) , in . readString ( ) ) ; res . setAliases ( aliases ) ; } cnt = in . readInt ( ) ; if ( cnt > 0 ) { Collection < QueryIndex > indexes = new ArrayList < > ( cnt ) ; for ( int i = 0 ; i < cnt ; i ++ ) indexes . add ( readQueryIndex ( in ) ) ; res . setIndexes ( indexes ) ; } return res ; }
reads the query entity .
