mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Improve InstanceManager#getInstance comment
This commit is contained in:
parent
d733dbbc3f
commit
886c4ca9c9
@ -155,17 +155,17 @@ public final class InstanceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets instance by given UUID.
|
* Gets an instance by the given UUID.
|
||||||
*
|
*
|
||||||
* @param uuid UUID of the instance
|
* @param uuid UUID of the instance
|
||||||
* @return {@link Optional#empty()} if instance is not found
|
* @return the instance with the given UUID, null if not found
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@Nullable
|
||||||
public @Nullable Instance getInstance(UUID uuid) {
|
public Instance getInstance(@NotNull UUID uuid) {
|
||||||
Optional<Instance> instance = getInstances()
|
Optional<Instance> instance = getInstances()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(someInstance -> someInstance.getUniqueId().equals(uuid))
|
.filter(someInstance -> someInstance.getUniqueId().equals(uuid))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
return instance.orElse(null);
|
return instance.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user