private void checkValue ( Object value ) { if ( this . nonNull && value == null ) { throw new IllegalArgumentException ( String . format ( "The property [%s] may not be null!" , getKey ( ) ) ) ; } if ( getType ( ) != null && value != null && ! getType ( ) . isAssignableFrom ( value . getClass ( ) ) ) { throw new IllegalArgumentException ( String . format ( "The value of property [%s] must be of type [%s], but was [%s]" , getKey ( ) , getType ( ) , value . getClass ( ) ) ) ; } }
Check that the value is compatible with the configure constraints .