@Override
  public Message messageFromObject() {
    TableInfo.Builder builder = TableInfo.newBuilder();
    builder.setName(name);
    for (TableRegionModel aRegion : regions) {
      TableInfo.Region.Builder regionBuilder = TableInfo.Region.newBuilder();
      regionBuilder.setName(aRegion.getName());
      regionBuilder.setId(aRegion.getId());
      regionBuilder.setStartKey(UnsafeByteOperations.unsafeWrap(aRegion.getStartKey()));
      regionBuilder.setEndKey(UnsafeByteOperations.unsafeWrap(aRegion.getEndKey()));
      regionBuilder.setLocation(aRegion.getLocation());
      builder.addRegions(regionBuilder);
    }
    return builder.build();
  }
@param regions the regions to set
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java