Package dk.gtz.graphedit.spi
Class ResponseContainer<T>
java.lang.Object
dk.gtz.graphedit.spi.ResponseContainer<T>
- Type Parameters:
T
- The type of the contained value
A container utility class that can hold either: nothing, valid value or an error.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ResponseContainer
public ResponseContainer()Constructs a new container instance
-
-
Method Details
-
set
Set the result value- Parameters:
e
- the result value
-
setError
Set the container to have an error.- Parameters:
e
- the error to hold
-
get
Get the contained value.- Returns:
- An instance of T
- Throws:
RuntimeException
- if an error had occurred or if the value is not present
-