public ValidationData save ( ValidationData data ) { if ( data . getParamType ( ) == null || data . getUrl ( ) == null || data . getMethod ( ) == null || data . getType ( ) == null || data . getTypeClass ( ) == null ) { throw new ValidationLibException ( "mandatory field is null " , HttpStatus . BAD_REQUEST ) ; } ValidationData existData = this . findById ( data . getId ( ) ) ; if ( existData == null ) { return this . addData ( data ) ; } else { existData . setValidationRules ( data . getValidationRules ( ) ) ; return existData ; } }
Save validation data .