ImmutableSortedSet < String > typesToImport ( ) { ImmutableSortedSet . Builder < String > typesToImport = ImmutableSortedSet . naturalOrder ( ) ; for ( Map . Entry < String , Spelling > entry : imports . entrySet ( ) ) { if ( entry . getValue ( ) . importIt ) { typesToImport . add ( entry . getKey ( ) ) ; } } return typesToImport . build ( ) ; }
Returns the set of types to import . We import every type that is neither in java . lang nor in the package containing the AutoValue class provided that the result refers to the type unambiguously . For example if there is a property of type java . util . Map . Entry then we will import java . util . Map . Entry and refer to the property as Entry . We could also import just java . util . Map in this case and refer to Map . Entry but currently we never do that .