public static boolean nameMatches ( DatabaseObject databaseObject1 , DatabaseObject databaseObject2 , Database accordingTo ) { String object1Name = accordingTo . correctObjectName ( databaseObject1 . getName ( ) , databaseObject1 . getClass ( ) ) ; String object2Name = accordingTo . correctObjectName ( databaseObject2 . getName ( ) , databaseObject2 . getClass ( ) ) ; if ( ( object1Name == null ) && ( object2Name == null ) ) { return true ; } if ( ( object1Name == null ) || ( object2Name == null ) ) { return false ; } if ( accordingTo . isCaseSensitive ( ) ) { return object1Name . equals ( object2Name ) ; } else { return object1Name . equalsIgnoreCase ( object2Name ) ; } }
Static so it can be used in other comparators if needed