Trouble adding component from string value

I want to do something like this:

private IAnimalFunctions a1; //This is a class

string animal = PlayerPrefs.GetString ("animal1") + "Functions";

a1 = gameObject.AddComponent(animal);

Gives following error: error CS0266: Cannot implicitly convert type UnityEngine.Component' to IAnimalFunctions’. An explicit conversion exists (are you missing a cast?)

But it works if I write it like this:

a1 = gameObject.AddComponent<SheepFunctions>();

The animal string’s value is equal to “SheepFunctions”. Is this possible, if so - how?

Ok I solved it by myself. If anyone else is interested to know, I did like this:

a1 = gameObject.AddComponent(animal) as IAnimalFunctions;