So here is a relatively dumb question I am sure. I have multiple capabilities. 3 at the moment but only 2 are actually registered and being used the 3rd is completely disabled and not even registered as I am still working on it. When the time comes I want to Register correctly. As it is set-up now, each capability has an event handler (the stupid part that is probably wrong).
In each capabilities' EventHandler has the particular effects that I want that Capability to work with. So th
LazyOptional is just a lazily-instantiated Optional.
It still holds a value, that value is of type T. T as in LazyOptional<T>
That value gets cast to T when you call someLazy.cast(), so if the value actually stored in the LazyOptional is not actually of type T, the cast will fail.
Optionals are just a box wrapped around a concrete object because you don't know if that object actually exists or not (which is why you have to use ifPresent, orElse, or orElseThrow--depend