Add valueKey, a quick method to get a key when you are sure the key exists.
Rename findKey to findValueKey for consistency.
*/
ResourceKey key();
+ /**
+ * Gets the {@link ResourceKey key} for a particular value.
+ *
+ * <p>Great care needs to be made in calling this method with any uncertainty as to
+ * if the key will exist. Should the value lack a key, a
+ * {@link IllegalStateException}</p> will be thrown. Therefore, it is advised to call
+ * {@link Registry#findValueKey(Object)} instead.</p>
+ *
+ * @param value The value
+ * @return The key
+ */
+ ResourceKey valueKey(T value);
+
/**
* Gets the {@link ResourceKey key} for a particular value, if found.
*
* @param value The value
* @return The key or {@link Optional#empty()}
*/
- Optional<ResourceKey> findKey(T value);
+ Optional<ResourceKey> findValueKey(T value);
/**
* Gets the {@link RegistryEntry entry} for a particular {@link ResourceKey key}, if found.
