Roger Federer beat the Romanian qualifier Marius Copil to claim the Swiss Indoors title for the ninth time.