@ Nullable public Import find ( @ Nonnull final String typeName ) { Check . notEmpty ( typeName , "typeName" ) ; Import ret = null ; final Type type = new Type ( typeName ) ; for ( final Import imp : imports ) { if ( imp . getType ( ) . getName ( ) . equals ( type . getName ( ) ) ) { ret = imp ; break ; } } if ( ret == null ) { final Type javaLangType = Type . evaluateJavaLangType ( typeName ) ; if ( javaLangType != null ) { ret = Import . of ( javaLangType ) ; } } return ret ; }
Searches the set of imports to find a matching import by type name .