public class CheckMisconfigured extends Object
They are intended to be used inside an overridden AnchorBean.checkMisconfigured(org.anchoranalysis.bean.BeanInstanceMap)
method.
Modifier and Type | Method and Description |
---|---|
static void |
atLeastOne(String property1Name,
String property2Name,
boolean property1Defined,
boolean property2Defined)
Checks that one of two properties is defined, or both.
|
static void |
oneOnly(String property1Name,
String property2Name,
boolean property1Defined,
boolean property2Defined)
Checks that one of two properties is defined, but not both simultaneously.
|
public static void oneOnly(String property1Name, String property2Name, boolean property1Defined, boolean property2Defined) throws BeanMisconfiguredException
This imposes an exclusive or check.
property1Name
- name of first property (for error messages).property2Name
- name of second property (for error messages).property1Defined
- whether the first property is defined.property2Defined
- whether the second property is defined.BeanMisconfiguredException
- if neither or both properties are defined.public static void atLeastOne(String property1Name, String property2Name, boolean property1Defined, boolean property2Defined) throws BeanMisconfiguredException
This imposes an or check.
property1Name
- name of first property (for error messages).property2Name
- name of second property (for error messages).property1Defined
- whether the first property is defined.property2Defined
- whether the second property is defined.BeanMisconfiguredException
- if neither are defined.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.