Class LoadResult<T>

  • All Implemented Interfaces:
    Result<T>

    public class LoadResult<T>
    extends Object
    implements Result<T>

    Enhances the basic Result with some additional methods useful when loading data.

    Author:
    Jeff Schnitzer
    • Constructor Detail

      • LoadResult

        public LoadResult​(Key<T> key,
                          Result<T> result)
    • Method Detail

      • now

        public T now()
        Obtain the loaded value now.
        Specified by:
        now in interface Result<T>
        Returns:
        the computed result
      • safe

        public final T safe()
                     throws NotFoundException
        Like now(), but throws NotFoundException instead of returning null.
        Throws:
        NotFoundException - if the loaded value was not found