code: public static Resource fromRaw(RawResource r, Function<String, Optional<ResourceType>> rtLoader) {
          return new Resource(r.getId(), r.getName(), r.getFeedId(), rtLoader.apply(r.getTypeId()).orElse(null),
                  r.getParentId(), r.getMetrics(), r.getProperties(), r.getConfig());
      }
docs: Converts {@link RawResource} into {@link Resource} using loader for {@link ResourceType}.
  The children are not loaded.
  @param r the resource to convert
  @param rtLoader loader for {@link ResourceType}
  @return the node without its subtree