private String generateModelId ( ) { String mt = this . modelType . toString ( ) ; StringBuilder mid = new StringBuilder ( mt ) ; Integer lastId = null ; if ( generatedModelIds . containsKey ( mt ) ) { lastId = generatedModelIds . get ( mt ) ; } else { lastId = new Integer ( - 1 ) ; } lastId ++ ; mid . append ( lastId ) ; generatedModelIds . put ( mt , lastId ) ; return mid . toString ( ) ; }
A method that tries to generate a model identifier for those times when models arrive without an identifier