Class MdibTreeValidator


  • public class MdibTreeValidator
    extends Object
    Utility class to verify cardinality and parent-child type correctness.
    • Method Detail

      • isManyAllowed

        public <T extends AbstractDescriptor> boolean isManyAllowed​(T child)
        Checks if a descriptor is allowed to appear many times as a child.
        Type Parameters:
        T - a descriptor type.
        Parameters:
        child - the descriptor to check.
        Returns:
        true if it is allowed to appear more than once, false otherwise.
      • isValidParent

        public boolean isValidParent​(AbstractDescriptor parent,
                                     AbstractDescriptor child)
        Checks if the parent child descriptor relation is eligible.
        Parameters:
        parent - the parent descriptor to check against.
        child - the child descriptor to check against.
        Returns:
        true if parent child relationship is eligible in terms of the BICEPS hierarchy.
      • allowedParents

        public Set<Class<?>> allowedParents​(AbstractDescriptor child)
        Resolves allowed parents descriptor type for a given child descriptor type.
        Parameters:
        child - the child where to retrieve parents for.
        Returns:
        a set of parent descriptor classes.