How can I eliminate duplicated Enum code?

后端 未结 15 924
眼角桃花
眼角桃花 2020-12-24 13:40

I have a large number of Enums that implement this interface:

/**
 * Interface for an enumeration, each element of which can be uniquely identified by its co         


        
15条回答
  •  猫巷女王i
    2020-12-24 14:10

    Abstract enums are potentially very useful (and currently not allowed). But a proposal and prototype exists if you'd like to lobby someone in Sun to add it:

    http://freddy33.blogspot.com/2007/11/abstract-enum-ricky-carlson-way.html

    Sun RFE:

    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6570766

提交回复
热议问题