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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValidationGroupsMetadata.BuilderBuilder forValidationGroupsMetadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidationGroupsMetadata.Builderbuilder()Creates a builder populated only with theDefaultgroup.booleancontainsGroup(Class<?> group)Checks if a given group has been added to the inheritance map.booleanequals(Object other)Set<Class<?>>findAllExtendedGroups(Collection<Class<?>> baseGroups)Finds all of the validation groups extended by an intial set of groups.Set<Class<?>>getAllGroupsAndSequences()Recursively gets all of the groups and sequence groups in the map (children and parents alike) in one flat set.Set<Class<?>>getGroupSequences()Returns all the known group sequence classes.Set<Class<?>>getParentsOfGroup(Class<?> group)If the group has been added to the map then its parent groups (of one level above) are retrieved.Set<Class<?>>getRootGroups()Returns all of the groups added to the map (but not their parents).List<Class<?>>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).booleanisInheritanceMapEmpty()booleanisSeqeuence(Class<?> sequence)Checks if a given class is a group sequence map.booleanisSequenceMapEmpty()StringtoString()
-
-
-
Method Detail
-
builder
public static ValidationGroupsMetadata.Builder builder()
Creates a builder populated only with theDefaultgroup.- 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
-
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
-
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()
-
-