Class ValidationGroupsMetadata
java.lang.Object
de.knightsoftnet.validators.client.impl.metadata.ValidationGroupsMetadata
Contains all the information known about the inheritance information for validation groups.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder populated only with theDefaultgroup.booleancontainsGroup(Class<?> group) Checks if a given group has been added to the inheritance map.booleanfindAllExtendedGroups(Collection<Class<?>> baseGroups) Finds all of the validation groups extended by an intial set of groups.Recursively gets all of the groups and sequence groups in the map (children and parents alike) in one flat set.Returns all the known group sequence classes.getParentsOfGroup(Class<?> group) If the group has been added to the map then its parent groups (of one level above) are retrieved.Returns all of the groups added to the map (but not their parents).getSequenceList(Class<?> sequence) If the sequence class has been added to the map then the actual sequence list is retrieved.inthashCode()booleanhasParents(Class<?> group) Checks if a group extends other groups (has parents).booleanbooleanisSeqeuence(Class<?> sequence) Checks if a given class is a group sequence map.booleantoString()
-
Method Details
-
builder
Creates a builder populated only with theDefaultgroup.- Returns:
- group builder
-
containsGroup
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
-
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
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
Returns all the known group sequence classes.- Returns:
- set of groups
-
getParentsOfGroup
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
Returns all of the groups added to the map (but not their parents).- Returns:
- set of groups
-
getSequenceList
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() -
hasParents
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
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
-