mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-09 17:26:07 +00:00
make registry return optional for get operations
This commit is contained in:
@@ -15,6 +15,7 @@ import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
@@ -28,9 +29,8 @@ public interface Registry<T> extends TypeLoader<T> {
|
||||
*
|
||||
* @return Value matching the identifier, {@code null} if no value is present.
|
||||
*/
|
||||
@NotNull
|
||||
@Contract(pure = true)
|
||||
T get(@NotNull String identifier) throws NoSuchEntryException;
|
||||
Optional<T> get(@NotNull String identifier);
|
||||
|
||||
/**
|
||||
* Check if the registry contains a value.
|
||||
|
||||
@@ -5,7 +5,4 @@ public class NoSuchEntryException extends RuntimeException {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public NoSuchEntryException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user