public static void parseResultToCollection(final Result result,
    Collection<QuotaSettings> quotaSettings) throws IOException {

    QuotaTableUtil.parseResult(result, new QuotaTableUtil.QuotasVisitor() {
      @Override
      public void visitUserQuotas(String userName, Quotas quotas) {
        quotaSettings.addAll(QuotaSettingsFactory.fromUserQuotas(userName, quotas));
      }

      @Override
      public void visitUserQuotas(String userName, TableName table, Quotas quotas) {
        quotaSettings.addAll(QuotaSettingsFactory.fromUserQuotas(userName, table, quotas));
      }

      @Override
      public void visitUserQuotas(String userName, String namespace, Quotas quotas) {
        quotaSettings.addAll(QuotaSettingsFactory.fromUserQuotas(userName, namespace, quotas));
      }

      @Override
      public void visitTableQuotas(TableName tableName, Quotas quotas) {
        quotaSettings.addAll(QuotaSettingsFactory.fromTableQuotas(tableName, quotas));
      }

      @Override
      public void visitNamespaceQuotas(String namespace, Quotas quotas) {
        quotaSettings.addAll(QuotaSettingsFactory.fromNamespaceQuotas(namespace, quotas));
      }

      @Override
      public void visitRegionServerQuotas(String regionServer, Quotas quotas) {
        quotaSettings.addAll(QuotaSettingsFactory.fromRegionServerQuotas(regionServer, quotas));
      }
    });
  }
Extracts the {@link SpaceViolationPolicy} and {@link TableName} from the provided
{@link Result} and adds them to the given {@link Map}. If the result does not contain the
expected information or the serialized policy in the value is invalid, this method will throw
an {@link IllegalArgumentException}.
@param result    A row from the quota table.
@param snapshots A map of snapshots to add the result of this method into.
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java