no.ssb.lds.api.specification.Specification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of linked-data-store-persistence-provider-api Show documentation
Show all versions of linked-data-store-persistence-provider-api Show documentation
LinkedDataStore Persistence Provider API
package no.ssb.lds.api.specification;
import java.util.Set;
public interface Specification {
SpecificationElement getRootElement();
Set getManagedDomains();
default SpecificationElement getElement(String managedDomain, String[] path) {
SpecificationElement se = getRootElement().getProperties().get(managedDomain);
for (int i = 0; i < path.length; i++) {
String pathElement = path[i];
if (se.getJsonTypes().contains("array")) {
continue; // skip array index navigation
}
SpecificationElement next = se.getProperties().get(pathElement);
se = next;
}
return se;
}
}