Class ValidationGroupsMetadata


  • public class ValidationGroupsMetadata
    extends Object
    Contains all the information known about the inheritance information for validation groups.
    • Method Detail

      • containsGroup

        public boolean containsGroup​(Class<?> group)
        Checks if a given group has been added to the inheritance map.
        Parameters:
        group - group to check
        Returns:
        true if group is contained in keys
      • findAllExtendedGroups

        public Set<Class<?>> findAllExtendedGroups​(Collection<Class<?>> baseGroups)
                                            throws IllegalArgumentException
        Finds all of the validation groups extended by an intial set of groups.
        Parameters:
        baseGroups - The initial set of groups to find parents of. These groups must have been added to the inheritance map already.
        Returns:
        A unified set of groups and their parents.
        Throws:
        IllegalArgumentException - If an initial group has not been added to the map before calling this method.
      • getAllGroupsAndSequences

        public Set<Class<?>> getAllGroupsAndSequences()
        Recursively gets all of the groups and sequence groups in the map (children and parents alike) in one flat set.
        Returns:
        set of groups
      • getGroupSequences

        public Set<Class<?>> getGroupSequences()
        Returns all the known group sequence classes.
        Returns:
        set of groups
      • getParentsOfGroup

        public Set<Class<?>> getParentsOfGroup​(Class<?> group)
        If the group has been added to the map then its parent groups (of one level above) are retrieved. Otherwise null is returned.
        Parameters:
        group - validation group class
        Returns:
        set of groups
        See Also:
        containsGroup(Class), findAllExtendedGroups(Collection)
      • getRootGroups

        public Set<Class<?>> getRootGroups()
        Returns all of the groups added to the map (but not their parents).
        Returns:
        set of groups
      • getSequenceList

        public List<Class<?>> getSequenceList​(Class<?> sequence)
        If the sequence class has been added to the map then the actual sequence list is retrieved. Otherwise null is returned.
        Parameters:
        sequence - class
        Returns:
        list of classes
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • hasParents

        public boolean hasParents​(Class<?> group)
        Checks if a group extends other groups (has parents).
        Parameters:
        group - group to check
        Returns:
        true if group has parents
      • isInheritanceMapEmpty

        public boolean isInheritanceMapEmpty()
      • isSeqeuence

        public boolean isSeqeuence​(Class<?> sequence)
        Checks if a given class is a group sequence map.
        Parameters:
        sequence - class to check
        Returns:
        true if class is a sequence
      • isSequenceMapEmpty

        public boolean isSequenceMapEmpty()