All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.ssb.lds.api.specification.Specification Maven / Gradle / Ivy

There is a newer version: 0.13
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy