public class ExclusiveRule extends Object implements Rule
Exclusive attributes can also be marked as required via RequiredRule
.
In such case exclusiveness is checked first.
The exclusiveness condition is satisfied when either one of the following applies:
E.g. if:
Constructor and Description |
---|
ExclusiveRule(Collection<Set<String>> exclusives) |
ExclusiveRule(Collection<Set<String>> exclusives,
List<String> required) |
Modifier and Type | Method and Description |
---|---|
String |
getDescription() |
String |
toString() |
boolean |
validate(Object object)
Validate a given object.
|
public ExclusiveRule(Collection<Set<String>> exclusives, List<String> required)
exclusives
- Collection of sets of mutually exclusive attributes.required
- List of required attributes (in the order in which attributes should be checked).public ExclusiveRule(Collection<Set<String>> exclusives)
exclusives
- Collection of sets of mutually exclusive attributes.public boolean validate(Object object)
Rule
public String getDescription()
getDescription
in interface Rule
Copyright © 2016–2021. All rights reserved.