Package ste.lloop

Class ReturnValue

All Implemented Interfaces:
Serializable

public class ReturnValue extends RuntimeException
A holder for a return value that can be used in a lambda expression.
See Also:
  • Constructor Details

    • ReturnValue

      public ReturnValue(Object value)
      Constructs a new ReturnValue instance with the given value.
      Parameters:
      value - the initial value
    • ReturnValue

      public ReturnValue()
      Constructs a new ReturnValue instance with a null value.
  • Method Details

    • value

      public <R> R value()
      Returns the stored value, cast to a generic type R.
      Type Parameters:
      R - the type to cast the value to
      Returns:
      the stored value
    • fillInStackTrace

      public Throwable fillInStackTrace()
      Overridden to avoid to create a stack trace, which is an expensive and resource intensive operation.
      Overrides:
      fillInStackTrace in class Throwable
      Returns:
      this
    • toString

      public String toString()
      Overrides:
      toString in class Throwable