Klasse Error<T>

java.lang.Object
de.srsoftware.tools.Error<T>
Typparameter:
T - The return type for actual results
Alle implementierten Schnittstellen:
Result<T>

public class Error<T> extends Object implements Result<T>
Generic Error class for methods that return Result
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Error(String cause)
    Create an Error carrying its cause
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    Get the cause of the error.
    boolean
    Indicate, whether a given result is an error.
    org.json.JSONObject
    Create a json object of the error.
    static <T> Error<T>
    message(String cause, Object... tokens)
    Create an Error object carrying the given cause and add more metadata

    Von Klasse geerbte Methoden java.lang.Object

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

    • Error

      public Error(String cause)
      Create an Error carrying its cause
      Parameter:
      cause - a description why the error was returned
  • Methodendetails

    • cause

      public String cause()
      Get the cause of the error.
      Gibt zurück:
      return the message describing what caused the error
    • 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.
    • message

      public static <T> Error<T> message(String cause, Object... tokens)
      Create an Error object carrying the given cause and add more metadata
      Typparameter:
      T - the type of the result that was expected
      Parameter:
      cause - a description why the error was returned
      tokens - additional metadata
      Gibt zurück:
      the created Error
    • json

      public org.json.JSONObject json()
      Create a json object of the error.
      Gibt zurück:
      the json object describing the error.