public static class Validator.Relationship extends Object
BulletConfig. You should have defined
Validator.Entry for these fields before you try to define relationships between them. You can use this to apply a
BiPredicate to these fields and provide or use their defined defaults (defined using
Validator.Entry.defaultTo(Object)) if the check fails. You may also ask the relationship to fail with
orFail() if you do not want it to default..| Modifier and Type | Method and Description |
|---|---|
Validator.Relationship |
checkIf(BiPredicate<Object,Object> binaryRelation)
Provide the
BiPredicate that acts as the check for this relationship. |
void |
orElseUse(Object objectA,
Object objectB)
Provide custom defaults for this Relationship if you do not want to use the defaults provided in their
Entries.
|
void |
orFail()
Fail if this relationship fails to hold.
|
public Validator.Relationship checkIf(BiPredicate<Object,Object> binaryRelation)
BiPredicate that acts as the check for this relationship. You can provide more checks
and they will be ANDed on the existing checks.binaryRelation - A check for this relationship.public void orElseUse(Object objectA, Object objectB)
objectA - The default for the first field.objectB - The default for the second field.public void orFail()
Copyright © 2021. All rights reserved.