Schnittstelle Result<Content>

Typparameter:
Content - The expected type of the result payload
Alle bekannten Implementierungsklassen:
Error, Payload

public interface Result<Content>
This interface can be used as a result type for functions that may return something or an error.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    <Mapped> Result<Mapped>
    map(Function<Result<Content>,Result<Mapped>> mapper)
    Transform this Result object to another via a mapping function.
    Create an Optional from a Result.
    <Inner> Stream<Result<Inner>>
    Create a stream of the Payload.
  • Methodendetails

    • map

      <Mapped> Result<Mapped> map(Function<Result<Content>,Result<Mapped>> mapper)
      Transform this Result object to another via a mapping function.
      Typparameter:
      Mapped - the payload type of the result of the mapping function
      Parameter:
      mapper - a function, that processes results and produces results
      Gibt zurück:
      the result of the mapping function
    • optional

      Optional<Content> optional()
      Create an Optional from a Result.
      Gibt zurück:
      An optional containing the Result`s content, if set.
    • stream

      <Inner> Stream<Result<Inner>> stream()
      Create a stream of the Payload. This may be suitable, if the payload is a collection.
      Typparameter:
      Inner - the type of the payloads of the elements of the stream
      Gibt zurück:
      a stream of results