Class ValidationGroupsMetadata

java.lang.Object
de.knightsoftnet.validators.client.impl.metadata.ValidationGroupsMetadata

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

    • builder

      public static ValidationGroupsMetadata.Builder builder()
      Creates a builder populated only with the Default group.
      Returns:
      group builder
    • 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
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • 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:
    • 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()
    • toString

      public String toString()
      Overrides:
      toString in class Object