Record Class EffectResult

java.lang.Object
java.lang.Record
com.kingsrook.qqq.backend.core.jobs.effects.EffectResult

public record EffectResult(EffectResult.Outcome outcome, String providerRef, String message) extends Record
What a target's delivery attempt achieved. - SENT: delivered (providerRef: the provider's id, if any). - RETRY: definitely not delivered, try again later (e.g., 429/503 before the request was accepted). - FAILED: definitely not delivered, and retrying will not help (e.g., 400). - UNKNOWN: it may have been delivered (a timeout after sending, a dropped connection). Never treated as "not delivered".
  • Constructor Details

    • EffectResult

      public EffectResult(EffectResult.Outcome outcome, String providerRef, String message)
      Creates an instance of a EffectResult record class.
      Parameters:
      outcome - the value for the outcome record component
      providerRef - the value for the providerRef record component
      message - the value for the message record component
  • Method Details

    • sent

      public static EffectResult sent(String providerRef)
      Delivered.
    • retry

      public static EffectResult retry(String message)
      Not delivered; retry later.
    • failed

      public static EffectResult failed(String message)
      Not delivered; do not retry.
    • unknown

      public static EffectResult unknown(String message)
      May or may not have been delivered.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • outcome

      public EffectResult.Outcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • providerRef

      public String providerRef()
      Returns the value of the providerRef record component.
      Returns:
      the value of the providerRef record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component