I have built myself a generic collection class which is defined like this.
public class StatisticItemHits{...}
This class can be
As others have said, you cannot use type restrictions in this way. What you can do is to specialise from your base type as follows:
public class StatisticItemHits { }
public class StringStatisticItemHits : StatisticItemHits { }
public class IntegerStatisticItemHits : StatisticItemHits { }
Also, as your base class is generic, you won't be able to use this to polymorphically. If you need to do this make StatisticItemHits implement an interface and use this to reference instances. Something like:
public class StatisticItemHits : IStaticticItemHits { }
public interface IStatisticItemHits { }