public static Result toResult(final ClientProtos.Result proto, boolean decodeTags) {
    if (proto.hasExists()) {
      if (proto.getStale()) {
        return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE_STALE : EMPTY_RESULT_EXISTS_FALSE_STALE;
      }
      return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE : EMPTY_RESULT_EXISTS_FALSE;
    }

    List<CellProtos.Cell> values = proto.getCellList();
    if (values.isEmpty()) {
      return proto.getStale() ? EMPTY_RESULT_STALE : EMPTY_RESULT;
    }

    List<Cell> cells = new ArrayList<>(values.size());
    ExtendedCellBuilder builder = ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY);
    for (CellProtos.Cell c : values) {
      cells.add(toCell(builder, c, decodeTags));
    }
    Result r = Result.create(cells, null, proto.getStale(), proto.getPartial());
    if (proto.hasMetrics()) {
      r.setMetrics(toQueryMetrics(proto.getMetrics()));
    }
    return r;
  }
Convert a protocol buffer Result to a client Result
@param proto      the protocol buffer Result to convert
@param decodeTags whether to decode tags into converted client Result When @decodeTags is set
                  to true, it will decode all the tags from the response. These tags may
                  contain some sensitive data like acl permissions, etc. Only the tools like
                  Export, Import which needs to take backup needs to set it to true so that
                  cell tags are persisted in backup. Refer to HBASE-25246 for more context.
@return the converted client Result
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java