boolean isNameUnique ( String name , String currentJobName ) { Item item = getItem ( name ) ; if ( null == item ) { // the candidate name didn't return any items so the name is unique return true ; } else if ( item . getName ( ) . equals ( currentJobName ) ) { // the candidate name returned an item, but the item is the item // that the user is configuring so this is ok return true ; } else { // the candidate name returned an item, so it is not unique return false ; } }
True if there is no item in Jenkins that has this name