Package de.srsoftware.tools
Klasse Error<None>
java.lang.Object
de.srsoftware.tools.Error<None>
- Typparameter:
None- This result is not expected to carry a payload in the sense of a positive execution result.
- Alle implementierten Schnittstellen:
Result<None>
This class may be returned by methods whose execution failed.
It may carry additional data about the cause of the failure
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungadd an exception to this Error objectAdd values to the data mapdata()return the data mapget the list of Exceptions added to this Error objectstatic <None> Error<None> create a new Error object with the message formatted with the given fillsorg.json.JSONObjectjson()Create a json object of the error.<Mapped> Result<Mapped> Transform this Result object to another via a mapping function.static <None> Error<None> create a new Error object carrying the passed messageoptional()Create an Optional from a Result.stream()Create a stream of the Payload.toString()<NewType> Error<NewType> create an Error with the same metadata content as this Object, but with different payload typewrap()Wrap an error object as Optional
-
Konstruktordetails
-
Error
create a new Error object carrying the passed message- Parameter:
message- the message to add to the Error object
-
-
Methodendetails
-
add
add an exception to this Error object- Parameter:
exception- the exception to add- Gibt zurück:
- this object
-
addData
Add values to the data map- Parameter:
tokens- a list of objects. The even elements are used as key in the data map, the odd ones as values.- Gibt zurück:
- this Error object
-
data
return the data map- Gibt zurück:
- metadata added to this Error object
-
exceptions
get the list of Exceptions added to this Error object- Gibt zurück:
- the list of Exceptions
-
format
create a new Error object with the message formatted with the given fills- Typparameter:
None- any type- Parameter:
message- a message string, which may contain placeholdersfills- the objects to replace the placeholders- Gibt zurück:
- a new Error object populated with the formatted message
-
json
public org.json.JSONObject json()Create a json object of the error.- Gibt zurück:
- the json object describing the error.
-
map
Beschreibung aus Schnittstelle kopiert:ResultTransform this Result object to another via a mapping function. -
of
create a new Error object carrying the passed message- Typparameter:
None- any type- Parameter:
message- the message to add to the Error objectexceptions- exceptions to be added to the errors metadata- Gibt zurück:
- a new Error object populated with the passed message
-
optional
Beschreibung aus Schnittstelle kopiert:ResultCreate an Optional from a Result. -
stream
Beschreibung aus Schnittstelle kopiert:ResultCreate a stream of the Payload. This may be suitable, if the payload is a collection. -
toString
-
transform
create an Error with the same metadata content as this Object, but with different payload type- Typparameter:
NewType- the payload type of the returned error- Gibt zurück:
- the transformed Error (new object)
-
wrap
Wrap an error object as Optional- Gibt zurück:
- an Optional carrying this Error object
-