Class ResponseContainer<T>

java.lang.Object
dk.gtz.graphedit.spi.ResponseContainer<T>
Type Parameters:
T - The type of the contained value

public class ResponseContainer<T> extends Object
A container utility class that can hold either: nothing, valid value or an error.
  • Constructor Details

    • ResponseContainer

      public ResponseContainer()
      Constructs a new container instance
  • Method Details

    • set

      public void set(T e)
      Set the result value
      Parameters:
      e - the result value
    • setError

      public void setError(Throwable e)
      Set the container to have an error.
      Parameters:
      e - the error to hold
    • get

      public T get()
      Get the contained value.
      Returns:
      An instance of T
      Throws:
      RuntimeException - if an error had occurred or if the value is not present