Record Class SmsRequested

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.application.sms.SmsRequested
Record Components:
to - the destination.
text - the text, which may carry a code.

public record SmsRequested(PhoneNumber to, String text) extends Record
Event published when a text message, whose cost is already recorded within the budget, must be sent. It is sent once the transaction that recorded it commits, outside of it and off the request thread, so the gateway's latency neither holds a database connection nor shows in the response.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    The field for the text record component.
    private final PhoneNumber
    The field for the to record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Validates the event.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the text record component.
    to()
    Returns the value of the to record component.
    Describes the event without the number and the text, so neither ever reaches a log.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • to

      private final PhoneNumber to
      The field for the to record component.
    • text

      private final String text
      The field for the text record component.
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Describes the event without the number and the text, so neither ever reaches a log.
      Specified by:
      toString in class Record
      Returns:
      the description.
    • 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.
    • to

      public PhoneNumber to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • text

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