Description
Currently I'm doing this to pull the name field out of EntryKey
@SneakyThrows private static MethodHandle entryKeyNameField() { return MethodHandles.privateLookupIn(EntryKey.class, MethodHandles.lookup()) .findGetter(EntryKey.class, "name", String.class); } private static final MethodHandle entryKeyNameField = entryKeyNameField(); @SneakyThrows static String getName(EntryKey entryKey) { return (String) entryKeyNameField.invokeExact(entryKey); }
It would be nice if getName() was a method on EntryKey itself.