Class DictionaryCondition
Checks if a value in a
Dictionary
is equal to an expected value.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe dictionary to provide a value to check.getKey()
The key in the dictionary whose value is checked.getValue()
The value the key should have in the dictionary, in order for the condition to be fulfilled.boolean
Checks if the condition is true by comparing the value in the dictionary with the expected value.void
setDictionary
(DictionaryProvider dictionary) The dictionary to provide a value to check.void
The key in the dictionary whose value is checked.void
The value the key should have in the dictionary, in order for the condition to be fulfilled.Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
DictionaryCondition
public DictionaryCondition()
-
-
Method Details
-
isConditionTrue
Checks if the condition is true by comparing the value in the dictionary with the expected value.- Returns:
- true if the value in the dictionary matches the expected value, false otherwise.
- Throws:
ProvisionFailedException
- if the dictionary cannot be created or the key doesn't exist in the dictionary.
-
getDictionary
The dictionary to provide a value to check. -
getKey
The key in the dictionary whose value is checked. -
setKey
The key in the dictionary whose value is checked. -
getValue
The value the key should have in the dictionary, in order for the condition to be fulfilled. -
setValue
The value the key should have in the dictionary, in order for the condition to be fulfilled.
-