diff --git a/src/main/java/com/github/lokic/javaplus/property/KeyEnum.java b/src/main/java/com/github/lokic/javaplus/property/KeyEnum.java index 0924d88..fb16291 100644 --- a/src/main/java/com/github/lokic/javaplus/property/KeyEnum.java +++ b/src/main/java/com/github/lokic/javaplus/property/KeyEnum.java @@ -9,17 +9,17 @@ public interface KeyEnum & KeyEnum> { TypeSafeMap CACHE = new TypeSafeMap(new ConcurrentHashMap<>()); - int getKey(); + int getKeyCode(); - static & KeyEnum> T keyOf(Class enumType, Integer key) { + static & KeyEnum> T keyCodeOf(Class enumType, Integer key) { return getProperty(enumType).of(key); } static & KeyEnum> Property1 getProperty(Class enumType) { return CACHE., Property1>getMap() .computeIfAbsent(enumType, SneakyThrowsFunctional.function(t -> { - //Note: JDK-8141508 bug,必须写成 ke -> ke.getKey(),不要使用方法引用 - return new Property1<>(enumType, ke -> ke.getKey()); + //Note: JDK-8141508 bug,必须写成 ke -> ke.getKeyCode(),不要使用方法引用 + return new Property1<>(enumType, ke -> ke.getKeyCode()); })); }