public static RepositoryCapabilities convertRepositoryCapabilities(Map<String, Object> json) {
if (json == null) {
return null;
}
RepositoryCapabilitiesImpl result = new RepositoryCapabilitiesImpl();
result.setCapabilityContentStreamUpdates(getEnum(json, JSON_CAP_CONTENT_STREAM_UPDATES,
CapabilityContentStreamUpdates.class));
result.setCapabilityChanges(getEnum(json, JSON_CAP_CHANGES, CapabilityChanges.class));
result.setCapabilityRendition(getEnum(json, JSON_CAP_RENDITIONS, CapabilityRenditions.class));
result.setSupportsGetDescendants(getBoolean(json, JSON_CAP_GET_DESCENDANTS));
result.setSupportsGetFolderTree(getBoolean(json, JSON_CAP_GET_FOLDER_TREE));
result.setSupportsMultifiling(getBoolean(json, JSON_CAP_MULTIFILING));
result.setSupportsUnfiling(getBoolean(json, JSON_CAP_UNFILING));
result.setSupportsVersionSpecificFiling(getBoolean(json, JSON_CAP_VERSION_SPECIFIC_FILING));
result.setIsPwcSearchable(getBoolean(json, JSON_CAP_PWC_SEARCHABLE));
result.setIsPwcUpdatable(getBoolean(json, JSON_CAP_PWC_UPDATABLE));
result.setAllVersionsSearchable(getBoolean(json, JSON_CAP_ALL_VERSIONS_SEARCHABLE));
result.setCapabilityQuery(getEnum(json, JSON_CAP_QUERY, CapabilityQuery.class));
result.setCapabilityJoin(getEnum(json, JSON_CAP_JOIN, CapabilityJoin.class));
result.setCapabilityAcl(getEnum(json, JSON_CAP_ACL, CapabilityAcl.class));
// handle extensions
convertExtension(json, result, CAP_KEYS);
return result;