Class StatusWithResult<T>


  • public class StatusWithResult<T>
    extends Status
    A Status that can also hold a result.
    • Constructor Detail

      • StatusWithResult

        protected StatusWithResult​(StatusFlag flag,
                                   java.lang.String messageOrNull,
                                   T resultOrNull)
    • Method Detail

      • createErrorWithResult

        public static <T> StatusWithResult<T> createErrorWithResult​(boolean retriable)
        Create an error.
        Parameters:
        retriable - If true, the error will be marked 'retriable'.
      • createErrorx

        public static <T> StatusWithResult<T> createErrorx​(boolean retriable,
                                                           java.lang.String message)
      • createErrorWithResult

        public static <T> StatusWithResult<T> createErrorWithResult()
      • createErrorWithResult

        public static <T> StatusWithResult<T> createErrorWithResult​(java.lang.String message)
      • createRetriableErrorWithResult

        public static <T> StatusWithResult<T> createRetriableErrorWithResult()
      • createRetriableErrorWithResult

        public static <T> StatusWithResult<T> createRetriableErrorWithResult​(java.lang.String message)
      • tryGetResult

        public final T tryGetResult()
        Returns the result of the operation (may be null).
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Status
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Status
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Status