Record Class JmsResultFactory<T extends JmsAttributes>

java.lang.Object
java.lang.Record
org.mule.jms.commons.internal.message.JmsResultFactory<T>

public record JmsResultFactory<T extends JmsAttributes>(JmsAttributesBuilderFactory builderFactory) extends Record
Factory class for creating an Operation Result based on a JMS Message
Since:
1.0
  • Constructor Details

    • JmsResultFactory

      public JmsResultFactory(JmsAttributesBuilderFactory builderFactory)
      Creates an instance of a JmsResultFactory record class.
      Parameters:
      builderFactory - the value for the builderFactory record component
  • Method Details

    • getInstance

      public static JmsResultFactory<?> getInstance()
    • createResult

      public org.mule.runtime.extension.api.runtime.operation.Result<Object,T> createResult(jakarta.jms.Message jmsMessage, JmsSpecification specification, String contentType, String encoding, String ackId) throws IOException, jakarta.jms.JMSException
      Creates a Result from a JMS Message based on the current configurations
      Parameters:
      jmsMessage - the JMS Message to convert
      specification - the JmsSpecification used to obtain the Message
      contentType - the contentType of the Message content
      encoding - the encoding of the Message content
      ackId - the ID required to perform an ACK on the Session the Message belongs to
      Returns:
      an Operation Result containing the content, headers and properties of the original Message
      Throws:
      IOException
      jakarta.jms.JMSException
    • createEmptyResult

      public org.mule.runtime.extension.api.runtime.operation.Result<Object,T> createEmptyResult()
      Creates an empty Result
      Returns:
      an Operation Result containing the a null payload and no attributes
    • 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.
    • builderFactory

      public JmsAttributesBuilderFactory builderFactory()
      Returns the value of the builderFactory record component.
      Returns:
      the value of the builderFactory record component