public void registerScaleCallBack ( String callBackName , Runnable callBack ) { Preconditions . checkNotNull ( callBackName , "callBackName" ) ; Preconditions . checkNotNull ( callBack , "callBack" ) ; if ( callBacks . containsKey ( callBackName ) ) { throw new IllegalArgumentException ( "The callBackName " + callBackName + " is duplicated and has been registered already." ) ; } else { callBacks . put ( callBackName , callBack ) ; } }
Register callback and deduplicate it if any .