Package org.apache.bval.jsr.groups
Class Group
- java.lang.Object
-
- org.apache.bval.jsr.groups.Group
-
- All Implemented Interfaces:
GroupStrategy
public final class Group extends Object implements GroupStrategy
Immutable object that wraps an interface representing a single group.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Group.Sequence
Models a group sequence.-
Nested classes/interfaces inherited from interface org.apache.bval.jsr.groups.GroupStrategy
GroupStrategy.Composite, GroupStrategy.Simple
-
-
Field Summary
Fields Modifier and Type Field Description static Group
DEFAULT
the Default Group-
Fields inherited from interface org.apache.bval.jsr.groups.GroupStrategy
EMPTY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applyTo(Predicate<GroupStrategy> operation)
Apply the specifiedboolean
-returningoperation
.boolean
equals(Object o)
Class<?>
getGroup()
Get the actual group class.Set<Group>
getGroups()
Get the associated groups.int
hashCode()
boolean
isDefault()
Learn whether the group represented is the default group.static Group
of(Class<?> group)
GroupStrategy
redefining(Map<Group,? extends GroupStrategy> redefinitions)
Get an equivalent strategy making group substitutions specified byredefinitions
.static Group.Sequence
sequence(Collection<Group> groups)
static Group.Sequence
sequence(Group... groups)
String
toString()
-
-
-
Field Detail
-
DEFAULT
public static final Group DEFAULT
the Default Group
-
-
Constructor Detail
-
Group
public Group(Class<?> group)
Create a new Group instance.- Parameters:
group
-
-
-
Method Detail
-
sequence
public static final Group.Sequence sequence(Group... groups)
-
sequence
public static final Group.Sequence sequence(Collection<Group> groups)
-
getGroup
public Class<?> getGroup()
Get the actual group class.- Returns:
-
isDefault
public boolean isDefault()
Learn whether the group represented is the default group.- Returns:
- boolean
-
getGroups
public Set<Group> getGroups()
Description copied from interface:GroupStrategy
Get the associated groups.- Specified by:
getGroups
in interfaceGroupStrategy
- Returns:
Set
ofGroup
-
applyTo
public boolean applyTo(Predicate<GroupStrategy> operation)
Description copied from interface:GroupStrategy
Apply the specifiedboolean
-returningoperation
.- Specified by:
applyTo
in interfaceGroupStrategy
- Returns:
boolean
-
redefining
public GroupStrategy redefining(Map<Group,? extends GroupStrategy> redefinitions)
Description copied from interface:GroupStrategy
Get an equivalent strategy making group substitutions specified byredefinitions
.- Specified by:
redefining
in interfaceGroupStrategy
- Returns:
GroupStrategy
-
-