Klasse Payload<T>

java.lang.Object
de.srsoftware.tools.Payload<T>
Typparameter:
T - the type of the expected payload
Alle implementierten Schnittstellen:
Result<T>

public class Payload<T> extends Object implements Result<T>
A wrapper for results that carry an actual payload
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Payload(T object)
    Wrap a payload as a successful instance of Result
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    get()
    get the payload
    boolean
    Indicate, whether a given result is an error.
    static <T> Payload<T>
    of(T object)
    wrap a payload

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • Payload

      public Payload(T object)
      Wrap a payload as a successful instance of Result
      Parameter:
      object - the payload object
  • Methodendetails

    • of

      public static <T> Payload<T> of(T object)
      wrap a payload
      Typparameter:
      T - the type of the payload
      Parameter:
      object - the payload to pack
      Gibt zurück:
      the wrapped payload object
    • isError

      public boolean isError()
      Beschreibung aus Schnittstelle kopiert: Result
      Indicate, whether a given result is an error.
      Angegeben von:
      isError in Schnittstelle Result<T>
      Gibt zurück:
      true, only it the returned value denotes an error.
    • get

      public T get()
      get the payload
      Gibt zurück:
      the payload object