Package de.srsoftware.tools.container
Klasse Payload<Content>
java.lang.Object
de.srsoftware.tools.container.Payload<Content>
- Typparameter:
Content- the type of the expected payload
- Alle implementierten Schnittstellen:
Container<Content>
A wrapper for results that carry an actual payload
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungget()get the payloadstatic <P> Container<P> of(P object) wrap a payloadoptional()Create an Optional from a Result.<Inner> Stream<Inner> stream()Create a stream of the Payload.Create a stream of the Payload.<T> Tmap a payload to another objecttoString()
-
Konstruktordetails
-
Payload
Wrap a payload as a successful instance of Result- Parameter:
object- the payload object
-
-
Methodendetails
-
get
get the payload- Gibt zurück:
- the payload object
-
of
wrap a payload- Typparameter:
P- the type of the payload- Parameter:
object- the payload to pack- Gibt zurück:
- the wrapped payload object
-
optional
Beschreibung aus Schnittstelle kopiert:ContainerCreate an Optional from a Result. -
stream
Beschreibung aus Schnittstelle kopiert:ContainerCreate a stream of the Payload. This may be suitable, if the payload is a collection.- Angegeben von:
streamin SchnittstelleContainer<Content>- Typparameter:
Inner- the type of the elements of the stream- Gibt zurück:
- a stream of the contents items.
- Löst aus:
ClassCastException
-
streamContained
Beschreibung aus Schnittstelle kopiert:ContainerCreate a stream of the Payload. This may be suitable, if the payload is a collection.- Angegeben von:
streamContainedin SchnittstelleContainer<Content>- Typparameter:
Inner- the type of the payloads of the elements of the stream- Gibt zurück:
- a stream of results
-
then
map a payload to another object- Typparameter:
T- type of the expected result- Parameter:
mapper- the mapper function- Gibt zurück:
- the object returned by the mapper function
-
toString
-