/** Returns a map of the sub-resources on this resource. */
  public Map<String, RestResource> getResources() {
    if (resource.getResources() == null) {
      return Collections.emptyMap();
    }

    return Maps.transformValues(
        resource.getResources(),
        new Function<Restresource, RestResource>() {
          public RestResource apply(Restresource input) {
            return new RestResource(input, topLevelSchemas);
          }
        });
  }
  /** Returns a map of the methods on this resource. */
  public Map<String, RestMethod> getMethods() {
    if (resource.getMethods() == null) {
      return Collections.emptyMap();
    }

    return Maps.transformValues(
        resource.getMethods(),
        new Function<Restmethod, RestMethod>() {
          public RestMethod apply(Restmethod input) {
            return new RestMethod(topLevelSchemas, input);
          }
        });
  }