Interface FieldRuleResult
public interface FieldRuleResult
Provides methods to retrieve information after evaluating a field rule.
-
Method Summary
Modifier and TypeMethodDescriptiongetError()
Returns field rule evaluation error.Retrieves the target field name corresponding to this field rule evaluation.getValue()
Retrieves the value for the evaluated target field, already converted into the appropriate ValueType.<T> T
getValueByType
(ValueType<T> type) Retrieves the value for the evaluated target field, converted to the type passed in.boolean
hasError()
Identifies if there was an error when evaluating this field rule.
-
Method Details
-
getTargetField
String getTargetField()Retrieves the target field name corresponding to this field rule evaluation.- Returns:
- the target field name
-
getValue
Object getValue()Retrieves the value for the evaluated target field, already converted into the appropriate ValueType. Use this method if you are unsure of the exact ValueType. Otherwise, usegetValueByType(ValueType)
.If there was an error during field rule evaluation this throws an exception. For example, if
hasError()
returnstrue
this will throw an exception.- Returns:
- the value converted into the appropriate ValueType of the field
-
getValueByType
Retrieves the value for the evaluated target field, converted to the type passed in. If the value cannot be converted to the passed in type, throws an exception.If there was an error during field rule evaluation this throws an exception. For example, if
hasError()
returnstrue
this will throw an exception.- Type Parameters:
T
- type of Java class that is backing aValueType
- Parameters:
type
- the type that the value to be converted into- Returns:
- the value converted to the passed in type
-
hasError
boolean hasError()Identifies if there was an error when evaluating this field rule.- Returns:
- true if there was an error when evaluating this field rule, otherwise false
-
getError
FieldRuleError getError()Returns field rule evaluation error.- Returns:
- field rule evaluation error if there was an error during evaluation, otherwise null
-