Package org.somda.sdc.biceps.common
Class MdibTreeValidator
- java.lang.Object
-
- org.somda.sdc.biceps.common.MdibTreeValidator
-
public class MdibTreeValidator extends Object
Utility class to verify cardinality and parent-child type correctness.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Class<?>>allowedParents(AbstractDescriptor child)Resolves allowed parents descriptor type for a given child descriptor type.<T extends AbstractDescriptor>
booleanisManyAllowed(T child)Checks if a descriptor is allowed to appear many times as a child.booleanisValidParent(AbstractDescriptor parent, AbstractDescriptor child)Checks if the parent child descriptor relation is eligible.
-
-
-
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.
-
-