Java generics of generics of

后端 未结 4 1936
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 10:04

I have a generic class which represents a fragment of text. That fragment of text may have any of a number of different modes (different types of highlighting). Those mode

4条回答
  •  太阳男子
    2020-12-15 10:28

    You need to introduce a new type that accounts for the bound of Enum

    public class TextFragment, E extends TextFragmentMode> {
    

提交回复
热议问题