2021
02-24
02-24
java 自定义可继承枚举Enum的案例
一、定义enum抽象类publicclassAbstractEnum{privatestaticfinalMap<String,AbstractEnum>nameEnumMap=newConcurrentHashMap<>();@GetterprotectedStringname;protectedAbstractEnum(){}protectedAbstractEnum(Stringname){this.name=name;if(!nameEnumMap.containsKey(name)){nameEnumMap.put(name,this);}}publicbooleanequals(AbstractEnumabstractEnum){returnthis.name...
继续阅读 >