For example in IntegerRangeValidator:
public class IntegerRangeValidator extends CustomValidator<Integer> {
private IntegerRangeValidator(int min, int max, String errorMessage) {
super(input -> input >= min && input <= max, errorMessage);
}
....
Could be:
public class IntegerRangeValidator extends CustomValidator<Integer> {
private IntegerRangeValidator(int min, int max, String errorMessage) {
super(input -> null != input && input >= min && input <= max, errorMessage);
}
....
Some background on my usage:
I had set the IntegerRangeValidator into a SingleSelectionField (Selection bound to an IntegerProperty).
Due to some design constraint, I needed to change the SingleSelectionField content using SingleSelectionField.items(List).. This part nullifies the bound IntegerProperty until I use SingleSelectionField.select(0).
This causes an unhandled NullPointerException.
Kindly correct me if I overlooked a better approach.
For example in IntegerRangeValidator:
Could be:
Some background on my usage:
I had set the IntegerRangeValidator into a SingleSelectionField (Selection bound to an IntegerProperty).
Due to some design constraint, I needed to change the SingleSelectionField content using
SingleSelectionField.items(List).. This part nullifies the bound IntegerProperty until I useSingleSelectionField.select(0).This causes an unhandled NullPointerException.
Kindly correct me if I overlooked a better approach.